summaryrefslogtreecommitdiffstats
path: root/nova/virt
diff options
context:
space:
mode:
authorEd Leafe <ed@leafe.com>2011-08-08 14:07:03 +0000
committerEd Leafe <ed@leafe.com>2011-08-08 14:07:03 +0000
commit10ab2e76b1ea8bbbb6bff4ccaf506bfdd5b57388 (patch)
treec61d801ff6e5754e0994fadd8d4db0f3661f4c53 /nova/virt
parentf1f86d229cff084a3f6257565a991c7ffe010907 (diff)
parentdcac4bc6c7be9832704e37cca7ce815e083974f5 (diff)
Updated with code changes on LP
Diffstat (limited to 'nova/virt')
-rw-r--r--nova/virt/driver.py8
-rw-r--r--nova/virt/fake.py4
-rw-r--r--nova/virt/hyperv.py4
-rw-r--r--nova/virt/libvirt/connection.py4
-rw-r--r--nova/virt/vmwareapi_conn.py4
-rw-r--r--nova/virt/xenapi/vmops.py10
-rw-r--r--nova/virt/xenapi_conn.py6
7 files changed, 18 insertions, 22 deletions
diff --git a/nova/virt/driver.py b/nova/virt/driver.py
index c6f686dbc..5d73eefc7 100644
--- a/nova/virt/driver.py
+++ b/nova/virt/driver.py
@@ -282,8 +282,8 @@ class ComputeDriver(object):
# TODO(Vek): Need to pass context in for access to auth_token
raise NotImplementedError()
- def set_host_powerstate(self, host, state):
- """Reboots or shuts down the host."""
+ def host_power_action(self, host, action):
+ """Reboots, shuts down or powers up the host."""
raise NotImplementedError()
def set_host_enabled(self, host, enabled):
@@ -291,10 +291,6 @@ class ComputeDriver(object):
# TODO(Vek): Need to pass context in for access to auth_token
raise NotImplementedError()
- def set_power_state(self, host, power_state):
- """Reboots, shuts down or starts up the host."""
- raise NotImplementedError()
-
def plug_vifs(self, instance, network_info):
"""Plugs in VIFs to networks."""
# TODO(Vek): Need to pass context in for access to auth_token
diff --git a/nova/virt/fake.py b/nova/virt/fake.py
index 9abefef1c..a811edf7a 100644
--- a/nova/virt/fake.py
+++ b/nova/virt/fake.py
@@ -512,8 +512,8 @@ class FakeConnection(driver.ComputeDriver):
"""Return fake Host Status of ram, disk, network."""
return self.host_status
- def set_host_powerstate(self, host, state):
- """Reboots or shuts down the host."""
+ def host_power_action(self, host, action):
+ """Reboots, shuts down or powers up the host."""
pass
def set_host_enabled(self, host, enabled):
diff --git a/nova/virt/hyperv.py b/nova/virt/hyperv.py
index be435ea16..6524e1739 100644
--- a/nova/virt/hyperv.py
+++ b/nova/virt/hyperv.py
@@ -499,8 +499,8 @@ class HyperVConnection(driver.ComputeDriver):
"""See xenapi_conn.py implementation."""
pass
- def set_host_powerstate(self, host, state):
- """Reboots or shuts down the host."""
+ def host_power_action(self, host, action):
+ """Reboots, shuts down or powers up the host."""
pass
def set_host_enabled(self, host, enabled):
diff --git a/nova/virt/libvirt/connection.py b/nova/virt/libvirt/connection.py
index 670352934..af5221f55 100644
--- a/nova/virt/libvirt/connection.py
+++ b/nova/virt/libvirt/connection.py
@@ -1562,8 +1562,8 @@ class LibvirtConnection(driver.ComputeDriver):
"""See xenapi_conn.py implementation."""
pass
- def set_host_powerstate(self, host, state):
- """Reboots or shuts down the host."""
+ def host_power_action(self, host, action):
+ """Reboots, shuts down or powers up the host."""
pass
def set_host_enabled(self, host, enabled):
diff --git a/nova/virt/vmwareapi_conn.py b/nova/virt/vmwareapi_conn.py
index 15d1d4cc3..cfa4cb418 100644
--- a/nova/virt/vmwareapi_conn.py
+++ b/nova/virt/vmwareapi_conn.py
@@ -191,8 +191,8 @@ class VMWareESXConnection(driver.ComputeDriver):
"""This method is supported only by libvirt."""
return
- def set_host_powerstate(self, host, state):
- """Reboots or shuts down the host."""
+ def host_power_action(self, host, action):
+ """Reboots, shuts down or powers up the host."""
pass
def set_host_enabled(self, host, enabled):
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
index 408e9f097..df90b62c4 100644
--- a/nova/virt/xenapi/vmops.py
+++ b/nova/virt/xenapi/vmops.py
@@ -1031,13 +1031,13 @@ class VMOps(object):
# TODO: implement this!
return 'http://fakeajaxconsole/fake_url'
- def set_host_powerstate(self, host, state):
- """Reboots or shuts down the host."""
- args = {"state": json.dumps(state)}
+ def host_power_action(self, host, action):
+ """Reboots, shuts down or powers up the host."""
+ args = {"action": json.dumps(action)}
methods = {"reboot": "host_reboot", "shutdown": "host_shutdown"}
- json_resp = self._call_xenhost(methods[state], args)
+ json_resp = self._call_xenhost(methods[action], args)
resp = json.loads(json_resp)
- return resp["powerstate"]
+ return resp["power_action"]
def set_host_enabled(self, host, enabled):
"""Sets the specified host's ability to accept new instances."""
diff --git a/nova/virt/xenapi_conn.py b/nova/virt/xenapi_conn.py
index a597d8602..720c9fd58 100644
--- a/nova/virt/xenapi_conn.py
+++ b/nova/virt/xenapi_conn.py
@@ -332,9 +332,9 @@ class XenAPIConnection(driver.ComputeDriver):
True, run the update first."""
return self.HostState.get_host_stats(refresh=refresh)
- def set_host_powerstate(self, host, state):
- """Reboots or shuts down the host."""
- return self._vmops.set_host_powerstate(host, state)
+ def host_power_action(self, host, action):
+ """Reboots, shuts down or powers up the host."""
+ return self._vmops.host_power_action(host, action)
def set_host_enabled(self, host, enabled):
"""Sets the specified host's ability to accept new instances."""