Review fixes
This commit is contained in:
parent
586359f792
commit
b23387ef7a
@ -997,12 +997,12 @@ class API(base.Base):
|
||||
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,
|
||||
instance_id=None, host=host, params={"enabled": enabled})
|
||||
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,
|
||||
instance_id=None, host=host, params={"action": action})
|
||||
host=host, params={"action": action})
|
||||
|
||||
@scheduler_api.reroute_compute("diagnostics")
|
||||
def get_diagnostics(self, context, instance_id):
|
||||
|
@ -958,14 +958,12 @@ class ComputeManager(manager.SchedulerDependentManager):
|
||||
result))
|
||||
|
||||
@exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
|
||||
def host_power_action(self, context, instance_id=None, host=None,
|
||||
action=None):
|
||||
def host_power_action(self, context, host=None, action=None):
|
||||
"""Reboots, shuts down or powers up the host."""
|
||||
return self.driver.host_power_action(host, action)
|
||||
|
||||
@exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
|
||||
def set_host_enabled(self, context, instance_id=None, host=None,
|
||||
enabled=None):
|
||||
def set_host_enabled(self, context, host=None, enabled=None):
|
||||
"""Sets the specified host's ability to accept new instances."""
|
||||
return self.driver.set_host_enabled(host, enabled)
|
||||
|
||||
|
@ -1045,7 +1045,7 @@ class VMOps(object):
|
||||
xenapi_resp = self._call_xenhost("set_host_enabled", args)
|
||||
try:
|
||||
resp = json.loads(xenapi_resp)
|
||||
except TypeError as e:
|
||||
except TypeError as e:
|
||||
# Already logged; return the message
|
||||
return xenapi_resp.details[-1]
|
||||
return resp["status"]
|
||||
|
@ -136,7 +136,7 @@ def host_shutdown(self, arg_dict):
|
||||
|
||||
@jsonify
|
||||
def host_start(self, arg_dict):
|
||||
"""Starts the host. NOTE: Currently not feasible, since the host
|
||||
"""Starts the host. Currently not feasible, since the host
|
||||
runs on the same machine as Xen.
|
||||
"""
|
||||
return _power_action("startup")
|
||||
|
Loading…
Reference in New Issue
Block a user