summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--nova/tests/compute/test_compute.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py
index 2d85b6cce..6eb5feb85 100644
--- a/nova/tests/compute/test_compute.py
+++ b/nova/tests/compute/test_compute.py
@@ -1787,13 +1787,11 @@ class ComputeTestCase(BaseTestCase):
self.compute.terminate_instance(self.context,
instance=jsonutils.to_primitive(instance))
- def _test_state_revert(self, operation, pre_task_state,
+ def _test_state_revert(self, instance, operation, pre_task_state,
post_task_state=None, kwargs=None):
if kwargs is None:
kwargs = {}
- instance = self._create_fake_instance()
-
# The API would have set task_state, so do that here to test
# that the state gets reverted on failure
db.instance_update(self.context, instance['uuid'],
@@ -1863,8 +1861,9 @@ class ComputeTestCase(BaseTestCase):
("resume_instance", task_states.RESUMING),
]
+ instance = self._create_fake_instance()
for operation in actions:
- self._test_state_revert(*operation)
+ self._test_state_revert(instance, *operation)
def _ensure_quota_reservations_committed(self):
"""Mock up commit of quota reservations."""