diff options
author | mbeierl <mark.beierl@dell.com> | 2018-04-05 12:31:39 -0400 |
---|---|---|
committer | mbeierl <mark.beierl@dell.com> | 2018-04-05 12:31:39 -0400 |
commit | 6d64efd6d50b728dc03ca465f45e15cbd79ce92a (patch) | |
tree | 296d81f6cf4b3b9ea0bdc5f70994f4b74331d384 /docker | |
parent | a1efb6bde04a0c1d993b40789b8f6f5cc1645734 (diff) |
Fixing daily job
Use Ubuntu 16.04 instead as it is LTS and not subject to change
Enhance error reporting on stack creation failure
Change-Id: Ie187ae44ce66564da9779733a418fc8bb4e1c320
JIRA: STORPERF-240
Signed-off-by: mbeierl <mark.beierl@dell.com>
Diffstat (limited to 'docker')
-rw-r--r-- | docker/storperf-master/rest_server.py | 1 | ||||
-rw-r--r-- | docker/storperf-master/storperf/storperf_master.py | 25 |
2 files changed, 19 insertions, 7 deletions
diff --git a/docker/storperf-master/rest_server.py b/docker/storperf-master/rest_server.py index 67d2d05..7f38ab6 100644 --- a/docker/storperf-master/rest_server.py +++ b/docker/storperf-master/rest_server.py @@ -192,6 +192,7 @@ class Configure(Resource): 'stack_id': storperf.stack_id}) except Exception as e: + self.logger.exception(e) abort(400, str(e)) @swagger.operation( diff --git a/docker/storperf-master/storperf/storperf_master.py b/docker/storperf-master/storperf/storperf_master.py index f4d41f3..7244b66 100644 --- a/docker/storperf-master/storperf/storperf_master.py +++ b/docker/storperf-master/storperf/storperf_master.py @@ -52,6 +52,8 @@ class StorPerfMaster(object): project_domain_id=os.environ.get('OS_PROJECT_DOMAIN_ID'), project_name=os.environ.get('OS_PROJECT_NAME')) + self.logger.debug("OSCreds: %s" % self.os_creds) + self.heat_stack = OpenStackHeatStack(self.os_creds, self.stack_settings) self.username = None @@ -137,8 +139,6 @@ class StorPerfMaster(object): if time_since_check.total_seconds() < 30: return self._cached_stack_id - self.logger.debug("OSCreds: %s" % self.os_creds) - self.heat_stack.initialize() if self.heat_stack.get_stack() is not None: self._last_snaps_check_time = datetime.now() @@ -274,12 +274,23 @@ class StorPerfMaster(object): res = heat_utils.get_resources(heat_cli, self.heat_stack.get_stack().id) self.logger.error("Stack creation failed") + reason = "" + failed = False for resource in res: - status = resource.status - self.logger.error("%s: %s" % (resource.name, status)) - if status == u'CREATE_FAILED': - self.delete_stack() - raise Exception(resource.status_reason) + if resource.status == u'CREATE_FAILED': + failed = True + reason += "%s: %s " % (resource.name, + resource.status_reason) + self.logger.error("%s - %s: %s" % (resource.name, + resource.status, + resource.status_reason)) + + if failed: + try: + self.heat_stack.clean() + except Exception: + pass + raise Exception(reason) def delete_stack(self): if self._test_executor is not None: |