From 76c96d0c7095978e5d51ead79f1a85eff46b4143 Mon Sep 17 00:00:00 2001 From: spisarski Date: Thu, 2 Nov 2017 14:52:58 -0600 Subject: Added logging when a heat stack fails. Added the stack resource reason to the error logs for each resource who's status is 'CREATE_FAILED'. All resons will be output to debug. JIRA: SNAPS-190 Change-Id: Ieb1cdb2089eb6e1c1a7c96c143b82af1b7a9efb7 Signed-off-by: spisarski --- snaps/openstack/utils/heat_utils.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'snaps/openstack/utils') diff --git a/snaps/openstack/utils/heat_utils.py b/snaps/openstack/utils/heat_utils.py index ad354e0..15c3533 100644 --- a/snaps/openstack/utils/heat_utils.py +++ b/snaps/openstack/utils/heat_utils.py @@ -23,8 +23,8 @@ from oslo_serialization import jsonutils from snaps import file_utils from snaps.domain.stack import Stack, Resource, Output -from snaps.openstack.utils import keystone_utils, neutron_utils, nova_utils, \ - cinder_utils +from snaps.openstack.utils import ( + keystone_utils, neutron_utils, nova_utils, cinder_utils) __author__ = 'spisarski' @@ -155,10 +155,13 @@ def get_resources(heat_cli, stack, res_type=None): out = list() for os_resource in os_resources: if ((res_type and os_resource.resource_type == res_type) - or not res_type): + or not res_type): out.append(Resource( + name=os_resource.resource_name, resource_type=os_resource.resource_type, - resource_id=os_resource.physical_resource_id)) + resource_id=os_resource.physical_resource_id, + status=os_resource.resource_status, + status_reason=os_resource.resource_status_reason)) return out @@ -197,8 +200,7 @@ def get_stack_networks(heat_cli, neutron, stack): out = list() resources = get_resources(heat_cli, stack, 'OS::Neutron::Net') for resource in resources: - network = neutron_utils.get_network_by_id( - neutron, resource.id) + network = neutron_utils.get_network_by_id(neutron, resource.id) if network: out.append(network) -- cgit 1.2.3-korg