summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerg Melikyan <smelikyan@mirantis.com>2013-11-19 19:39:05 +0400
committerSerg Melikyan <smelikyan@mirantis.com>2013-11-19 19:57:54 +0400
commit177713630d6689cd43226116d16ea5ebf5e2bba0 (patch)
tree0eec955004398d73fc7bbe18c5ef79e458981113
parent39ccf1d33f515710de6772462fad43aa81e822f3 (diff)
Resolved issue with details-page0.2.12release-0.2
Notes
Notes (review): Verified+2: Jenkins Approved+1: Timur Nurlygayanov <tnurlygayanov@mirantis.com> Code-Review+2: Timur Nurlygayanov <tnurlygayanov@mirantis.com> Submitted-by: Jenkins Submitted-at: Wed, 20 Nov 2013 09:24:48 +0000 Reviewed-on: https://review.openstack.org/57270 Project: stackforge/murano-dashboard Branch: refs/heads/release-0.2
-rw-r--r--muranodashboard/panel/tabs.py51
1 files changed, 26 insertions, 25 deletions
diff --git a/muranodashboard/panel/tabs.py b/muranodashboard/panel/tabs.py
index b7982a7..d20a380 100644
--- a/muranodashboard/panel/tabs.py
+++ b/muranodashboard/panel/tabs.py
@@ -72,32 +72,33 @@ class OverviewTab(tabs.Tab):
72 72
73 #check for deployed services so additional information can be added 73 #check for deployed services so additional information can be added
74 units = [] 74 units = []
75 instance_name = None
76 for unit in service_data.units: 75 for unit in service_data.units:
77 if hasattr(unit, 'state'): 76 if not hasattr(unit, 'state'):
78 # unit_detail = {'Name': unit.name} 77 continue
79 unit_detail = SortedDict() 78
80 instance_hostname = unit.state.hostname 79 unit_detail = SortedDict()
81 if 'Hostname template' in detail_info: 80 instance_hostname = unit.state.hostname
82 del detail_info['Hostname template'] 81 if 'Hostname template' in detail_info:
83 unit_detail['Hostname'] = instance_hostname 82 del detail_info['Hostname template']
84 instances = nova_api.server_list(request) 83
85 84 unit_detail['Hostname'] = instance_hostname
86 # HEAT always adds e before instance name 85 instances = nova_api.server_list(request)[0]
87 instance_name = 'e' + environment_id + '.' + instance_hostname 86
88 87 # HEAT always adds e before instance name
89 for instance in instances: 88 instance_name = 'e' + environment_id + '.' + instance_hostname
90 if instance._apiresource.name == instance_name: 89
91 unit_detail['instance'] = { 90 for instance in instances:
92 'id': instance._apiresource.id, 91 if instance.name == instance_name:
93 'name': instance_name 92 unit_detail['instance'] = {
94 } 93 'id': instance.id,
95 break 94 'name': instance_name
96 95 }
97 if len(service_data.units) > 1: 96 break
98 units.append(unit_detail) 97
99 else: 98 if len(service_data.units) > 1:
100 detail_info.update(unit_detail) 99 units.append(unit_detail)
100 else:
101 detail_info.update(unit_detail)
101 102
102 return {'service': detail_info, 'units': units} 103 return {'service': detail_info, 'units': units}
103 104