From: spisarski Date: Mon, 10 Jul 2017 21:34:40 +0000 (-0600) Subject: Fixed stack create status check on error. X-Git-Tag: opnfv-5.0.0~78 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=7e241389c1f6f2366f7d8bef29eae938aefa4936;p=snaps.git Fixed stack create status check on error. Was checking for the status string of "ERROR" when "CREATE_FAILED" should have been used. This bug caused the heat stack test to hang instead of raising an exception. Change-Id: I91e04d58bed083fd8b93ec908c766c0ddc4828de Signed-off-by: spisarski --- diff --git a/snaps/openstack/create_stack.py b/snaps/openstack/create_stack.py index 1492829..cb06e8a 100644 --- a/snaps/openstack/create_stack.py +++ b/snaps/openstack/create_stack.py @@ -25,6 +25,7 @@ logger = logging.getLogger('create_stack') STACK_COMPLETE_TIMEOUT = 1200 POLL_INTERVAL = 3 +STATUS_CREATE_FAILED = 'CREATE_FAILED' STATUS_CREATE_COMPLETE = 'CREATE_COMPLETE' STATUS_DELETE_COMPLETE = 'DELETE_COMPLETE' @@ -180,7 +181,7 @@ class OpenStackHeatStack: 'Cannot stack status for stack with ID - ' + self.__stack.id) return False - if status == 'ERROR': + if status == STATUS_CREATE_FAILED: raise StackCreationError('Stack had an error during deployment') logger.debug('Stack status is - ' + status) return status == expected_status_code