diff options
| author | Dan Prince <dprince@redhat.com> | 2012-08-01 10:55:14 -0400 |
|---|---|---|
| committer | Dan Prince <dprince@redhat.com> | 2012-08-01 10:55:14 -0400 |
| commit | 5e7275f5bca9c7c6f30a442c3bd2b66eba19fe04 (patch) | |
| tree | f8e20f82d52ad46f1dde77a5e5fc363c6e0730c8 /nova | |
| parent | fce61c1bc0ddb5e8bffdc5ed6345fc8c2d5bb0c3 (diff) | |
Fix get_diagnostics RPC arg ordering.
Updates the ordering of the compute managers get_diagnostics
call so it works correctly with the current wrap_instance_fault and
checks_instance_lock decorators. To work correctly 'instance' needs
to be the first argument after the context.
Fixes LP Bug #1031788.
Change-Id: Ia7105eb272cd2932fc4f25b297ecab9e5ab8dbe2
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/compute/manager.py | 2 | ||||
| -rw-r--r-- | nova/tests/compute/test_compute.py | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index fd0f9049a..26b8dbb7a 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -1762,7 +1762,7 @@ class ComputeManager(manager.SchedulerDependentManager): @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id()) @wrap_instance_fault - def get_diagnostics(self, context, instance_uuid=None, instance=None): + def get_diagnostics(self, context, instance=None, instance_uuid=None): """Retrieve diagnostics for an instance on this host.""" if not instance: instance = self.db.instance_get_by_uuid(context, instance_uuid) diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py index 5cee6f94d..8367065d3 100644 --- a/nova/tests/compute/test_compute.py +++ b/nova/tests/compute/test_compute.py @@ -868,7 +868,11 @@ class ComputeTestCase(BaseTestCase): self.compute.run_instance(self.context, instance['uuid']) diagnostics = self.compute.get_diagnostics(self.context, - instance['uuid']) + instance_uuid=instance['uuid']) + self.assertEqual(diagnostics, 'FAKE_DIAGNOSTICS') + + diagnostics = self.compute.get_diagnostics(self.context, + instance=instance) self.assertEqual(diagnostics, 'FAKE_DIAGNOSTICS') self.compute.terminate_instance(self.context, instance['uuid']) |
