diff options
| author | Matt Dietz <matt.dietz@rackspace.com> | 2011-08-18 22:10:35 +0000 |
|---|---|---|
| committer | Tarmac <> | 2011-08-18 22:10:35 +0000 |
| commit | 2cb2e71454373f6baa857c8d73122c485e18c4c3 (patch) | |
| tree | 1086f9dee0c6654ea6457f2355a31001e5dc508f | |
| parent | d327987cdd0eed43e5400b392086446b0c73b035 (diff) | |
| parent | f3f780858e4a4076905b09faf6902bcab1071f11 (diff) | |
Fixes lp828207
The Host API reboot action was broken due to addition of a parameter to a utility method in compute/api.py
| -rw-r--r-- | nova/compute/api.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index e909e9959..b3932c644 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -1068,15 +1068,21 @@ class API(base.Base): """Unpause the given instance.""" self._cast_compute_message('unpause_instance', context, instance_id) + def _call_compute_message_for_host(self, action, context, host, params): + """Call method deliberately designed to make host/service only calls""" + queue = self.db.queue_get_for(context, FLAGS.compute_topic, host) + kwargs = {'method': action, 'args': params} + return rpc.call(context, queue, kwargs) + def set_host_enabled(self, context, host, enabled): """Sets the specified host's ability to accept new instances.""" - return self._call_compute_message("set_host_enabled", context, + return self._call_compute_message_for_host("set_host_enabled", context, host=host, params={"enabled": enabled}) def host_power_action(self, context, host, action): """Reboots, shuts down or powers up the host.""" - return self._call_compute_message("host_power_action", context, - host=host, params={"action": action}) + return self._call_compute_message_for_host("host_power_action", + context, host=host, params={"action": action}) @scheduler_api.reroute_compute("diagnostics") def get_diagnostics(self, context, instance_id): |
