Check host is not none in host aggregate page
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
(cherry picked from commit 7f30ab5124
)
This commit is contained in:
parent
47e2406394
commit
306c5ca86c
|
@ -84,8 +84,10 @@ def get_available(zone):
|
|||
def get_zone_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
|
||||
|
|
Loading…
Reference in New Issue