Skip to content

Instantly share code, notes, and snippets.

Created April 22, 2014 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/11174357 to your computer and use it in GitHub Desktop.
Save anonymous/11174357 to your computer and use it in GitHub Desktop.
--- a/openstack_dashboard/dashboards/admin/info/tables.py 2014-04-22 13:04:25.631852097 +0200
+++ b/openstack_dashboard/dashboards/admin/info/tables.py 2014-04-22 13:05:17.038038608 +0200
@@ -57,8 +57,10 @@
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment