summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorEd Leafe <ed@leafe.com>2011-08-04 20:49:21 +0000
committerEd Leafe <ed@leafe.com>2011-08-04 20:49:21 +0000
commit75b110aa451382cce94f10a392597b40df97839c (patch)
tree14de2b2e55baa7eb37c30797f1b190e597fe0ccf /plugins
parent416686617944dba7fe9b77de294eee9e7e92a1cd (diff)
Changed all references to 'power state' to 'power action' as requested by review.
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/xenserver/xenapi/etc/xapi.d/plugins/xenhost12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/xenhost b/plugins/xenserver/xenapi/etc/xapi.d/plugins/xenhost
index c29d57717..f6a9ac8d8 100755
--- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/xenhost
+++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/xenhost
@@ -103,7 +103,7 @@ def set_host_enabled(self, arg_dict):
return {"status": status}
-def _powerstate(state):
+def _power_action(action):
host_uuid = _get_host_uuid()
# Host must be disabled first
result = _run_command("xe host-disable")
@@ -115,23 +115,23 @@ def _powerstate(state):
raise pluginlib.PluginError(result)
cmds = {"reboot": "xe host-reboot", "startup": "xe host-power-on",
"shutdown": "xe host-shutdown"}
- result = _run_command(cmds[state])
+ result = _run_command(cmds[action])
# Should be empty string
if result:
raise pluginlib.PluginError(result)
- return {"powerstate": state}
+ return {"power_action": action}
@jsonify
def host_reboot(self, arg_dict):
"""Reboots the host."""
- return _powerstate("reboot")
+ return _power_action("reboot")
@jsonify
def host_shutdown(self, arg_dict):
"""Reboots the host."""
- return _powerstate("shutdown")
+ return _power_action("shutdown")
@jsonify
@@ -139,7 +139,7 @@ def host_start(self, arg_dict):
"""Starts the host. NOTE: Currently not feasible, since the host
runs on the same machine as Xen.
"""
- return _powerstate("startup")
+ return _power_action("startup")
@jsonify