summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/utils
diff options
context:
space:
mode:
authorTaseer Ahmed <taseer94@gmail.com>2017-10-13 12:34:00 +0500
committerTaseer Ahmed <taseer94@gmail.com>2017-10-19 20:07:54 +0500
commitbc8f8f580bf356dace5fa0a0968f9d179d5e515a (patch)
treec6be68211d750e81910a75f3cc747fe9b27f4efc /snaps/openstack/utils
parent530153597deb5030c296358431d9549d13b7288b (diff)
Add reason for stack creation failure
JIRA: SNAPS-190 Change-Id: I59b7d416ef16cd1f301ccbdcdd8a7529527b3dd6 Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
Diffstat (limited to 'snaps/openstack/utils')
-rw-r--r--snaps/openstack/utils/heat_utils.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/snaps/openstack/utils/heat_utils.py b/snaps/openstack/utils/heat_utils.py
index 6910bfe..8b9395b 100644
--- a/snaps/openstack/utils/heat_utils.py
+++ b/snaps/openstack/utils/heat_utils.py
@@ -87,6 +87,16 @@ def get_stack_status(heat_cli, stack_id):
return heat_cli.stacks.get(stack_id).stack_status
+def get_stack_status_reason(heat_cli, stack_id):
+ """
+ Returns the current status of the Heat stack
+ :param heat_cli: the OpenStack heat client
+ :param stack_id: the ID of the heat stack to retrieve
+ :return: reason for stack creation failure
+ """
+ return heat_cli.stacks.get(stack_id).stack_status_reason
+
+
def create_stack(heat_cli, stack_settings):
"""
Executes an Ansible playbook to the given host