Merge "Check host is not none in each availability zone" into stable/havana

This commit is contained in:
Jenkins 2014-08-23 16:43:13 +00:00 committed by Gerrit Code Review
commit 15b7c6a8f9
1 changed files with 3 additions and 1 deletions

View File

@ -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