From cfceed71dabfbac538e65bd1d5a95197beb94001 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Mon, 5 Nov 2012 09:35:24 -0800 Subject: Look up stuck-in-rebooting instances in manager The poll_rebooting_instances() method for a virt driver can be called periodically from the manager to handle instances that may be stuck in a rebooting state. The only information passed to the virt driver is the configured timeout, which means any driver implementing this will have to do the same database query: db.instance_get_all_hung_un_rebooting (..., timeout). This patch makes the manager do this before calling the virt driver, passing the appropriate set of instances, which avoids the need for the driver to make that call. Related to bp/no-db-compute Change-Id: I152cb8cd9a107f2d2b1df39401ab7bbe7ff366f1 --- nova/tests/test_virt_drivers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nova/tests') diff --git a/nova/tests/test_virt_drivers.py b/nova/tests/test_virt_drivers.py index 1f30ee695..9d48cdf06 100644 --- a/nova/tests/test_virt_drivers.py +++ b/nova/tests/test_virt_drivers.py @@ -269,7 +269,8 @@ class _VirtDriverTestCase(_FakeDriverBackendTestCase): @catch_notimplementederror def test_poll_rebooting_instances(self): - self.connection.poll_rebooting_instances(10) + instances = [self._get_running_instance()] + self.connection.poll_rebooting_instances(10, instances) @catch_notimplementederror def test_poll_rescued_instances(self): -- cgit