diff options
author | George Shuklin <george.shuklin@gmail.com> | 2014-04-22 18:31:42 +0300 |
---|---|---|
committer | George Shuklin <george.shuklin@gmail.com> | 2014-04-22 18:34:46 +0300 |
commit | 6027a9558c4997cba2eb8ecd93e5cb7138b7510d (patch) | |
tree | d1635bea304bba805926ef6820f1a07e5db6227a | |
parent | c5c388cca3a0cf63ba490ba04abf9b09cf7fb7cf (diff) | |
download | horizon-6027a9558c4997cba2eb8ecd93e5cb7138b7510d.tar.gz |
Check host is not none in each availability zone
Check that host is not none before trying to parse the services that
are up in each availability zone
Change-Id: I757f35ca2fa84da3441b544280c1c430bf3e8fb8
Closes-Bug: #1297920
(adopted from commit 7f30ab5124618c5b11eebf9c6d69bcfd8a47adc3,
change path from 'dashboards/admin/aggregate' to
'dashboards/admin/info')
Original fix by Santiago Baldassin <santiago.b.baldassin@intel.com>
-rw-r--r-- | openstack_dashboard/dashboards/admin/info/tables.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/openstack_dashboard/dashboards/admin/info/tables.py b/openstack_dashboard/dashboards/admin/info/tables.py index d4f3fe74e..143d52991 100644 --- a/openstack_dashboard/dashboards/admin/info/tables.py +++ b/openstack_dashboard/dashboards/admin/info/tables.py @@ -57,8 +57,10 @@ def get_available(zone): def get_hosts(zone): hosts = zone.hosts host_details = [] + if hosts is None: + return [] for name, services in hosts.items(): - up = all([s['active'] and s['available'] for k, s in services.items()]) + up = all(s['active'] and s['available'] for s in services.values()) up = _("Services Up") if up else _("Services Down") host_details.append("%(host)s (%(up)s)" % {'host': name, 'up': up}) return host_details |