summaryrefslogtreecommitdiffstats
path: root/doctor_tests/stack.py
diff options
context:
space:
mode:
authorTomi Juvonen <tomi.juvonen@nokia.com>2018-09-28 12:15:43 +0300
committerTomi Juvonen <tomi.juvonen@nokia.com>2018-10-25 13:57:03 +0300
commita6575910a137f8932e294f66c9da3194ad937691 (patch)
treee11851ae691892fea7f0efb9922f115fbb0521a9 /doctor_tests/stack.py
parent61eb3927ada784cc3dffb5ddd17f66e47871f708 (diff)
Support Apex with services in containers
Upstream apex now works in containers, so if used, it needs to be supported JIRA: DOCTOR-130 Change-Id: I3d73a1699e4fee53b001f043f55d0eeefa7bfb7b Signed-off-by: Tomi Juvonen <tomi.juvonen@nokia.com>
Diffstat (limited to 'doctor_tests/stack.py')
-rw-r--r--doctor_tests/stack.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/doctor_tests/stack.py b/doctor_tests/stack.py
index 688c2050..ee586fa8 100644
--- a/doctor_tests/stack.py
+++ b/doctor_tests/stack.py
@@ -44,7 +44,7 @@ class Stack(object):
action_failed = '%s_FAILED' % action
status = action_in_progress
- stack_retries = 150
+ stack_retries = 160
while status == action_in_progress and stack_retries > 0:
time.sleep(2)
try:
@@ -88,7 +88,19 @@ class Stack(object):
template=template,
parameters=parameters)
self.stack_id = stack['stack']['id']
- self.wait_stack_create()
+ try:
+ self.wait_stack_create()
+ except Exception:
+ # It might not always work at first
+ self.log.info('retry creating maintenance stack.......')
+ self.delete()
+ time.sleep(3)
+ stack = self.heat.stacks.create(stack_name=self.stack_name,
+ files=files,
+ template=template,
+ parameters=parameters)
+ self.stack_id = stack['stack']['id']
+ self.wait_stack_create()
def update(self, stack_name, stack_id, template, parameters={}, files={}):
self.heat.stacks.update(stack_name=stack_name,