summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandy Walsh <sandy.walsh@rackspace.com>2011-03-24 05:02:54 -0700
committerSandy Walsh <sandy.walsh@rackspace.com>2011-03-24 05:02:54 -0700
commitf640d32bd8698fc2c30b2ca0454672d691f9b296 (patch)
tree4538708cb683bc7314e2f08493be26468d269e42
parent974b6502bb9e933955f6ea9acb6e6c47ce8d8588 (diff)
downloadnova-f640d32bd8698fc2c30b2ca0454672d691f9b296.tar.gz
nova-f640d32bd8698fc2c30b2ca0454672d691f9b296.tar.xz
nova-f640d32bd8698fc2c30b2ca0454672d691f9b296.zip
fix based on sirp's comments
-rw-r--r--nova/scheduler/api.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/nova/scheduler/api.py b/nova/scheduler/api.py
index c1417dfe4..a4f304c62 100644
--- a/nova/scheduler/api.py
+++ b/nova/scheduler/api.py
@@ -118,16 +118,15 @@ def child_zone_helper(zone_list, func):
_wrap_method(_process, func), zone_list)]
-def _issue_novaclient_command(nova, zone, collection, method_name, \
- item_id):
+def _issue_novaclient_command(nova, zone, collection, method_name, item_id):
"""Use novaclient to issue command to a single child zone.
One of these will be run in parallel for each child zone."""
+ manager = getattr(nova, collection)
result = None
try:
- manager = getattr(nova, collection)
- if isinstance(item_id, int) or item_id.isdigit():
+ try:
result = manager.get(int(item_id))
- else:
+ except ValueError, e:
result = manager.find(name=item_id)
except novaclient.NotFound:
url = zone.api_url