diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-12-08 08:25:58 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-12-08 08:25:58 +0000 |
| commit | 53942f6516cbbf74bdda093b499d49bd9d91f430 (patch) | |
| tree | 7f77cf0aa4995469d1249b3005464d9ef5020af8 /nova/api | |
| parent | 2082e47e90cda9edd9af35db6ca5c8e31760233b (diff) | |
| parent | 2a33f8d8cefdbde50f89e6d4084d513eadf3a97a (diff) | |
Merge "Fix positional arg swallow decorator"
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/contrib/hosts.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/nova/api/openstack/compute/contrib/hosts.py b/nova/api/openstack/compute/contrib/hosts.py index 8982f5724..0d2b68f11 100644 --- a/nova/api/openstack/compute/contrib/hosts.py +++ b/nova/api/openstack/compute/contrib/hosts.py @@ -93,7 +93,7 @@ class HostUpdateDeserializer(wsgi.XMLDeserializer): return dict(body=updates) -def _list_hosts(req, service=None): +def _list_hosts(req): """Returns a summary list of hosts, optionally filtering by service type. """ @@ -108,16 +108,13 @@ def _list_hosts(req, service=None): for host in services: hosts.append({"host_name": host['host'], 'service': host['topic'], 'zone': host['availability_zone']}) - if service: - hosts = [host for host in hosts - if host["service"] == service] return hosts def check_host(fn): """Makes sure that the host exists.""" - def wrapped(self, req, id, service=None, *args, **kwargs): - listed_hosts = _list_hosts(req, service) + def wrapped(self, req, id, *args, **kwargs): + listed_hosts = _list_hosts(req) hosts = [h["host_name"] for h in listed_hosts] if id in hosts: return fn(self, req, id, *args, **kwargs) |
