summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Kearney <josh@jk0.org>2011-11-30 16:21:12 -0600
committerJosh Kearney <josh@jk0.org>2011-11-30 16:21:17 -0600
commit15350bef95a1d34bf302c3516c9616d6dc314d56 (patch)
tree20fee3dd89982a6718829459ca6a3d4a4caaae1e
parent851f082ce8841073155885ab5c8cca27563cce0e (diff)
Adds missing image_meta to rescue's spawn() calls.
Change-Id: Id769c217611011d77abafa529c306f780475aaf4
-rw-r--r--nova/compute/manager.py3
-rw-r--r--nova/tests/test_compute.py2
-rw-r--r--nova/tests/test_xenapi.py2
-rw-r--r--nova/tests/xenapi/stubs.py2
-rw-r--r--nova/virt/xenapi/vmops.py8
-rw-r--r--nova/virt/xenapi_conn.py4
6 files changed, 11 insertions, 10 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index d41022044..9aeccc067 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -946,8 +946,9 @@ class ComputeManager(manager.SchedulerDependentManager):
instance_ref.admin_pass = kwargs.get('rescue_password',
utils.generate_password(FLAGS.password_length))
network_info = self._get_instance_nw_info(context, instance_ref)
+ image_meta = _get_image_meta(context, instance_ref['image_ref'])
- self.driver.rescue(context, instance_ref, network_info)
+ self.driver.rescue(context, instance_ref, network_info, image_meta)
current_power_state = self._get_power_state(context, instance_ref)
self._instance_update(context,
diff --git a/nova/tests/test_compute.py b/nova/tests/test_compute.py
index 64429c29f..0b1879ed1 100644
--- a/nova/tests/test_compute.py
+++ b/nova/tests/test_compute.py
@@ -255,7 +255,7 @@ class ComputeTestCase(BaseTestCase):
called = {'rescued': False,
'unrescued': False}
- def fake_rescue(self, context, instance_ref, network_info):
+ def fake_rescue(self, context, instance_ref, network_info, image_meta):
called['rescued'] = True
self.stubs.Set(nova.virt.fake.FakeConnection, 'rescue', fake_rescue)
diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py
index afa9e462f..906f176fd 100644
--- a/nova/tests/test_xenapi.py
+++ b/nova/tests/test_xenapi.py
@@ -641,7 +641,7 @@ class XenAPIVMTestCase(test.TestCase):
def test_rescue(self):
instance = self._create_instance()
conn = xenapi_conn.get_connection(False)
- conn.rescue(self.context, instance, [])
+ conn.rescue(self.context, instance, [], None)
def test_unrescue(self):
instance = self._create_instance()
diff --git a/nova/tests/xenapi/stubs.py b/nova/tests/xenapi/stubs.py
index 96c4d9cbe..84d0cb878 100644
--- a/nova/tests/xenapi/stubs.py
+++ b/nova/tests/xenapi/stubs.py
@@ -207,7 +207,7 @@ def stub_out_vm_methods(stubs):
def fake_release_bootlock(self, vm):
pass
- def fake_spawn_rescue(self, context, inst, network_info):
+ def fake_spawn_rescue(self, context, inst, network_info, image_meta):
inst._rescue = False
stubs.Set(vmops.VMOps, "_shutdown", fake_shutdown)
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
index abb12ed6c..aa8aa5e1d 100644
--- a/nova/virt/xenapi/vmops.py
+++ b/nova/virt/xenapi/vmops.py
@@ -220,9 +220,9 @@ class VMOps(object):
self._handle_spawn_error(vdis, spawn_error)
raise spawn_error
- def spawn_rescue(self, context, instance, network_info):
+ def spawn_rescue(self, context, instance, image_meta, network_info):
"""Spawn a rescue instance."""
- self.spawn(context, instance, network_info)
+ self.spawn(context, instance, image_meta, network_info)
def _create_vm(self, context, instance, vdis, network_info, image_meta):
"""Create VM instance."""
@@ -1098,7 +1098,7 @@ class VMOps(object):
vm_ref, False, True)
self._session.wait_for_task(task, instance.id)
- def rescue(self, context, instance, network_info):
+ def rescue(self, context, instance, network_info, image_meta):
"""Rescue the specified instance.
- shutdown the instance VM.
@@ -1116,7 +1116,7 @@ class VMOps(object):
self._shutdown(instance, vm_ref)
self._acquire_bootlock(vm_ref)
instance._rescue = True
- self.spawn_rescue(context, instance, network_info)
+ self.spawn_rescue(context, instance, image_meta, network_info)
rescue_vm_ref = VMHelper.lookup(self._session, instance.name)
rescue_vbd_ref = self._find_rescue_vbd_ref(vm_ref, rescue_vm_ref)
diff --git a/nova/virt/xenapi_conn.py b/nova/virt/xenapi_conn.py
index 73d1b0cb7..a48aba8c6 100644
--- a/nova/virt/xenapi_conn.py
+++ b/nova/virt/xenapi_conn.py
@@ -258,9 +258,9 @@ class XenAPIConnection(driver.ComputeDriver):
"""resume the specified instance"""
self._vmops.resume(instance)
- def rescue(self, context, instance, network_info):
+ def rescue(self, context, instance, network_info, image_meta):
"""Rescue the specified instance"""
- self._vmops.rescue(context, instance, network_info)
+ self._vmops.rescue(context, instance, network_info, image_meta)
def unrescue(self, instance, network_info):
"""Unrescue the specified instance"""