From 9b44077c202e7ee44aa26f3fa41e7b576bee8d50 Mon Sep 17 00:00:00 2001 From: Alexey Weyl Date: Mon, 21 Nov 2016 10:20:25 +0200 Subject: [PATCH] bug fix in heat. 1. show heat stack in error state. 2. event property changed to "project" insead of "project_id" Change-Id: Id0b2b31ccf0c3901730999dfd69c1203fb15ff7a --- vitrage/datasources/heat/stack/driver.py | 5 +---- vitrage/datasources/heat/stack/transformer.py | 3 ++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/vitrage/datasources/heat/stack/driver.py b/vitrage/datasources/heat/stack/driver.py index 9b298291a..4de9d1d1b 100644 --- a/vitrage/datasources/heat/stack/driver.py +++ b/vitrage/datasources/heat/stack/driver.py @@ -28,8 +28,6 @@ class HeatStackDriver(DriverBase): _client = None conf = None - FAILED = 'FAILED' - RESOURCE_TYPE_CONVERSION = { 'OS::Nova::Server': NOVA_INSTANCE_DATASOURCE, 'OS::Cinder::Volume': CINDER_VOLUME_DATASOURCE, @@ -90,8 +88,7 @@ class HeatStackDriver(DriverBase): HeatStackDriver.RESOURCE_TYPE_CONVERSION = tmp_dict def _make_stacks_list(self, stacks): - return [stack.__dict__ for stack in stacks - if self.FAILED not in stack.__dict__['stack_status']] + return [stack.__dict__ for stack in stacks] def _append_stacks_resources(self, stacks): return [self._retrieve_stack_resources(stack, stack['id']) diff --git a/vitrage/datasources/heat/stack/transformer.py b/vitrage/datasources/heat/stack/transformer.py index b24f6d3e3..6497f0f2a 100644 --- a/vitrage/datasources/heat/stack/transformer.py +++ b/vitrage/datasources/heat/stack/transformer.py @@ -49,11 +49,12 @@ class HeatStackTransformer(ResourceTransformerBase): super(HeatStackTransformer, self).__init__(transformers, conf) def _create_snapshot_entity_vertex(self, entity_event): + stack_name = extract_field_value(entity_event, 'stack_name') stack_id = extract_field_value(entity_event, 'id') stack_state = extract_field_value(entity_event, 'stack_status') timestamp = extract_field_value(entity_event, 'creation_time') - project_id = extract_field_value(entity_event, 'project_id') + project_id = extract_field_value(entity_event, 'project') return self._create_vertex(entity_event, stack_name,