summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/utils
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2017-11-02 14:52:58 -0600
committerspisarski <s.pisarski@cablelabs.com>2017-11-02 14:52:58 -0600
commit76c96d0c7095978e5d51ead79f1a85eff46b4143 (patch)
treea72a9882b0511f7d4c0c645310e2a8a8975ab296 /snaps/openstack/utils
parent7ddff3c75481b3c3d1b9cd39b88ed875a168d67d (diff)
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 <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/openstack/utils')
-rw-r--r--snaps/openstack/utils/heat_utils.py14
1 files changed, 8 insertions, 6 deletions
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)