--- /dev/null
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+from sqlalchemy import *
+from migrate import *
+
+
+def upgrade(migrate_engine):
+ meta = MetaData()
+ meta.bind = migrate_engine
+
+ stack = Table('stack', meta, autoload=True)
+ stack.c.timeout.alter(nullable=True)
+
+
+def downgrade(migrate_engine):
+ meta = MetaData()
+ meta.bind = migrate_engine
+
+ stack = Table('stack', meta, autoload=True)
+ stack.c.timeout.alter(nullable=False)
stack.update_and_save({'status': new_status,
'status_reason': reason})
+ def timeout_secs(self):
+ '''
+ Return the stack creation timeout in seconds, or None if no timeout
+ should be used.
+ '''
+ if self.timeout_mins is None:
+ return None
+
+ return self.timeout_mins * 60
+
def create(self):
'''
Create the stack and all of the resources.
resource_create)
create = scheduler.TaskRunner(create_task)
- with eventlet.Timeout(self.timeout_mins * 60) as tmo:
+ with eventlet.Timeout(self.timeout_secs()) as tmo:
try:
create()
except exception.ResourceFailure as ex:
r.cache_template()
# Now make the resources match the new stack definition
- with eventlet.Timeout(self.timeout_mins * 60) as tmo:
+ with eventlet.Timeout(self.timeout_secs()) as tmo:
try:
# First delete any resources which are not in newstack
for res in reversed(self):