diff options
| author | Daniel P. Berrange <berrange@redhat.com> | 2013-02-15 15:36:57 +0000 |
|---|---|---|
| committer | Daniel P. Berrange <berrange@redhat.com> | 2013-02-16 10:39:35 +0000 |
| commit | 5ec38e6a576e0102a951e45d6ee2753450bcd3f4 (patch) | |
| tree | be84720ae3531c6982c88a19bf87607d70fef077 /nova/tests | |
| parent | dc5a994e333c743f8ae8970ce0a2d8ca8c48d9f3 (diff) | |
Ensure there is only one instance of LibvirtDriver
The HostState() class in libvirt creates a second instance of
the LibvirtDriver() class, which cause duplicate initialization
of various things. This is pointless, since it was a method on
the original LibvirtDriver() which created the HostState()
instance, and thus it could easily pass in the original object.
Blueprint: compute-driver-events
Change-Id: I0734bfcc1b014406ffe64ef7abb14a533998dea2
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/test_libvirt.py | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py index c93bb0168..d2cd5a757 100644 --- a/nova/tests/test_libvirt.py +++ b/nova/tests/test_libvirt.py @@ -3393,13 +3393,7 @@ class HostStateTestCase(test.TestCase): return HostStateTestCase.instance_caps def test_update_status(self): - virtapi = fake.FakeVirtAPI() - self.mox.StubOutWithMock(libvirt_driver, 'LibvirtDriver') - libvirt_driver.LibvirtDriver(virtapi, True).AndReturn( - self.FakeConnection()) - - self.mox.ReplayAll() - hs = libvirt_driver.HostState(virtapi, True) + hs = libvirt_driver.HostState(self.FakeConnection()) stats = hs._stats self.assertEquals(stats["vcpus"], 1) self.assertEquals(stats["vcpus_used"], 0) |
