summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Kearney <josh.kearney@rackspace.com>2010-12-30 15:13:32 -0600
committerJosh Kearney <josh.kearney@rackspace.com>2010-12-30 15:13:32 -0600
commit42f6a993bcc4d0bc8823e4d039b1f59a6d6758a8 (patch)
tree30bb70cdad6026c9fbaa0a55517e0feeeaa47301
parent44c83db6130e2ac59fc0649c4e37d906e348dd78 (diff)
Implemented review feedback
-rw-r--r--nova/compute/manager.py6
-rw-r--r--nova/virt/fake.py3
-rw-r--r--nova/virt/libvirt_conn.py3
-rw-r--r--nova/virt/xenapi/vmops.py10
-rw-r--r--nova/virt/xenapi_conn.py4
5 files changed, 3 insertions, 23 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index 924b72004..d2ade8f52 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -299,7 +299,6 @@ class ComputeManager(manager.Manager):
@exception.wrap_exception
def get_diagnostics(self, context, instance_id):
"""Retrieve diagnostics for an instance on this server."""
- context = context.elevated()
instance_ref = self.db.instance_get(context, instance_id)
if instance_ref["state"] == power_state.RUNNING:
@@ -310,12 +309,13 @@ class ComputeManager(manager.Manager):
@exception.wrap_exception
def get_actions(self, context, instance_id):
"""Retrieve actions for an instance on this server."""
- context = context.elevated()
instance_ref = self.db.instance_get(context, instance_id)
logging.debug(_("instance %s: retrieving actions"),
instance_ref["internal_id"])
- return self.driver.get_actions(instance_ref)
+ return self.db.instance_get_actions(
+ context,
+ instance_id)
def suspend_instance(self, context, instance_id):
"""suspend the instance with instance_id"""
diff --git a/nova/virt/fake.py b/nova/virt/fake.py
index e9d1e4bd7..880772b22 100644
--- a/nova/virt/fake.py
+++ b/nova/virt/fake.py
@@ -205,9 +205,6 @@ class FakeConnection(object):
def get_diagnostics(self, instance_name):
pass
- def get_actions(self, instance_name):
- pass
-
def list_disks(self, instance_name):
"""
Return the IDs of all the virtual disks attached to the specified
diff --git a/nova/virt/libvirt_conn.py b/nova/virt/libvirt_conn.py
index 8407938c6..cf45ac13b 100644
--- a/nova/virt/libvirt_conn.py
+++ b/nova/virt/libvirt_conn.py
@@ -583,9 +583,6 @@ class LibvirtConnection(object):
def get_diagnostics(self, instance_name):
raise exception.APIError("diagnostics are not supported for libvirt")
- def get_actions(self, instance_name):
- raise exception.APIError("actions are not supported for libvirt")
-
def get_disks(self, instance_name):
"""
Note that this function takes an instance name, not an Instance, so
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
index 1dfb9005c..332e603db 100644
--- a/nova/virt/xenapi/vmops.py
+++ b/nova/virt/xenapi/vmops.py
@@ -226,16 +226,6 @@ class VMOps(object):
rec = self._session.get_xenapi().VM.get_record(vm)
return VMHelper.compile_diagnostics(self._session, rec)
- def get_actions(self, instance):
- """Return VM action history"""
- vm = VMHelper.lookup(self._session, instance.name)
- if vm is None:
- raise exception.NotFound(_("Instance not found %s") %
- instance.name)
- return db.instance_get_actions(
- context.get_admin_context(),
- instance.id)
-
def get_console_output(self, instance):
"""Return snapshot of console"""
# TODO: implement this to fix pylint!
diff --git a/nova/virt/xenapi_conn.py b/nova/virt/xenapi_conn.py
index 92274daf9..a7ec22012 100644
--- a/nova/virt/xenapi_conn.py
+++ b/nova/virt/xenapi_conn.py
@@ -163,10 +163,6 @@ class XenAPIConnection(object):
"""Return data about VM diagnostics"""
return self._vmops.get_diagnostics(instance)
- def get_actions(self, instance):
- """Return VM action history"""
- return self._vmops.get_actions(instance)
-
def get_console_output(self, instance):
"""Return snapshot of console"""
return self._vmops.get_console_output(instance)