diff options
| author | Josh Kearney <josh@jk0.org> | 2011-05-13 10:26:50 -0500 |
|---|---|---|
| committer | Josh Kearney <josh@jk0.org> | 2011-05-13 10:26:50 -0500 |
| commit | 60dcc66db2a08bd4acfe2f3fc3e66cc382e7d008 (patch) | |
| tree | 4e6777ccf29d27a99e9148c847e82a07fe70643f /nova/compute | |
| parent | b4357fef25a0f6a402979d15c1ecbf4abb8643a8 (diff) | |
Review feedback.
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/api.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index 29347bb4c..a12f8d515 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -19,6 +19,7 @@ """Handles all requests relating to instances (guest vms).""" import datetime +import eventlet import re import time @@ -495,6 +496,15 @@ class API(base.Base): raise exception.Error(_("Unable to find host for Instance %s") % instance_id) + def _set_admin_password(self, context, instance_id, password): + """Set the root/admin password for the given instance.""" + host = self._find_host(context, instance_id) + + rpc.cast(context, + self.db.queue_get_for(context, FLAGS.compute_topic, host), + {"method": "set_admin_password", + "args": {"instance_id": instance_id, "new_pass": password}}) + def snapshot(self, context, instance_id, name): """Snapshot the given instance. @@ -648,12 +658,8 @@ class API(base.Base): def set_admin_password(self, context, instance_id, password=None): """Set the root/admin password for the given instance.""" - host = self._find_host(context, instance_id) - - rpc.cast(context, - self.db.queue_get_for(context, FLAGS.compute_topic, host), - {"method": "set_admin_password", - "args": {"instance_id": instance_id, "new_pass": password}}) + eventlet.spawn_n(self._set_admin_password(context, instance_id, + password)) def inject_file(self, context, instance_id): """Write a file to the given instance.""" |
