diff options
| author | Robert Collins <robertc@robertcollins.net> | 2013-01-11 10:20:43 +1300 |
|---|---|---|
| committer | Robert Collins <robertc@robertcollins.net> | 2013-01-11 10:35:44 +1300 |
| commit | bda08f6a0713951db60adf62e44739bdea093b17 (patch) | |
| tree | 028601478f2462170950d892ae296136ac9b3b0f /nova | |
| parent | b35f86651120c52e611e671caad331e4f871c2cc (diff) | |
Change ComputerDriver.legacy_nwinfo to raise by default.
This makes non-updated hypervisors visible by grepping for 'def
legacy_nwinfo' rather than only the updated ones being visible, and
when new hypervisors are added, it will be clear whether they use the
legacy format or not.
Out of tree hypervisors will be broken by this, but the fix is
trivial::
def legacy_nwinfo(self):
# XXX TODO Update to use the non-legacy format.
return True
Change-Id: If5b461bc5d8e8dc21de3ca9cf521e7b341724900
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/tests/compute/test_resource_tracker.py | 6 | ||||
| -rw-r--r-- | nova/virt/baremetal/driver.py | 3 | ||||
| -rw-r--r-- | nova/virt/driver.py | 9 | ||||
| -rw-r--r-- | nova/virt/fake.py | 3 | ||||
| -rw-r--r-- | nova/virt/libvirt/driver.py | 3 | ||||
| -rw-r--r-- | nova/virt/vmwareapi/driver.py | 3 |
6 files changed, 22 insertions, 5 deletions
diff --git a/nova/tests/compute/test_resource_tracker.py b/nova/tests/compute/test_resource_tracker.py index afe05abe0..f5d523ec1 100644 --- a/nova/tests/compute/test_resource_tracker.py +++ b/nova/tests/compute/test_resource_tracker.py @@ -50,6 +50,9 @@ class UnsupportedVirtDriver(driver.ComputeDriver): # no support for getting resource usage info return {} + def legacy_nwinfo(self): + return True + class FakeVirtDriver(driver.ComputeDriver): @@ -80,6 +83,9 @@ class FakeVirtDriver(driver.ComputeDriver): } return d + def legacy_nwinfo(self): + return True + class BaseTestCase(test.TestCase): diff --git a/nova/virt/baremetal/driver.py b/nova/virt/baremetal/driver.py index 3659da711..462e0c444 100644 --- a/nova/virt/baremetal/driver.py +++ b/nova/virt/baremetal/driver.py @@ -166,6 +166,9 @@ class BareMetalDriver(driver.ComputeDriver): # TODO(deva): define the version properly elsewhere return 1 + def legacy_nwinfo(self): + return True + def list_instances(self): l = [] ctx = nova_context.get_admin_context() diff --git a/nova/virt/driver.py b/nova/virt/driver.py index b6a8a91ad..e396de6a0 100644 --- a/nova/virt/driver.py +++ b/nova/virt/driver.py @@ -727,11 +727,10 @@ class ComputeDriver(object): raise NotImplementedError() def legacy_nwinfo(self): - """ - Indicate if the driver requires the legacy network_info format. - """ - # TODO(tr3buchet): update all subclasses and remove this - return True + """True if the driver requires the legacy network_info format.""" + # TODO(tr3buchet): update all subclasses and remove this method and + # related helpers. + raise NotImplementedError(self.legacy_nwinfo) def manage_image_cache(self, context, all_instances): """ diff --git a/nova/virt/fake.py b/nova/virt/fake.py index 88346cc3a..0a29a6d67 100644 --- a/nova/virt/fake.py +++ b/nova/virt/fake.py @@ -403,6 +403,9 @@ class FakeDriver(driver.ComputeDriver): def list_instance_uuids(self): return [] + def legacy_nwinfo(self): + return True + class FakeVirtAPI(virtapi.VirtAPI): def instance_update(self, context, instance_uuid, updates): diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index ea6e0e6a0..66bd3bdaf 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -433,6 +433,9 @@ class LibvirtDriver(driver.ComputeDriver): except exception.NovaException: return False + def legacy_nwinfo(self): + return True + # TODO(Shrews): Remove when libvirt Bugzilla bug # 836647 is fixed. def list_instance_ids(self): if self._conn.numOfDomains() == 0: diff --git a/nova/virt/vmwareapi/driver.py b/nova/virt/vmwareapi/driver.py index c883d1edb..8734df1f6 100644 --- a/nova/virt/vmwareapi/driver.py +++ b/nova/virt/vmwareapi/driver.py @@ -118,6 +118,9 @@ class VMWareESXDriver(driver.ComputeDriver): # FIXME(sateesh): implement this pass + def legacy_nwinfo(self): + return True + def list_instances(self): """List VM instances.""" return self._vmops.list_instances() |
