diff options
| author | Josh Kearney <josh@jk0.org> | 2011-03-24 13:10:22 -0500 |
|---|---|---|
| committer | Josh Kearney <josh@jk0.org> | 2011-03-24 13:10:22 -0500 |
| commit | e976f5b3e6b02b4bb8c4144368b4c4e097df8b8c (patch) | |
| tree | 7c029e245690fd572c744964c884a8e950d55695 /nova/virt | |
| parent | 5774357b365e1db624cdd2a9abed9828b27e3314 (diff) | |
| parent | 0797161b89531cc8d5fe29c208723f39bcbd8046 (diff) | |
Merged trunk
Diffstat (limited to 'nova/virt')
| -rw-r--r-- | nova/virt/fake.py | 2 | ||||
| -rw-r--r-- | nova/virt/libvirt_conn.py | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/nova/virt/fake.py b/nova/virt/fake.py index 5b0fe1877..7018f8c1b 100644 --- a/nova/virt/fake.py +++ b/nova/virt/fake.py @@ -344,7 +344,7 @@ class FakeConnection(driver.ComputeDriver): Note that this function takes an instance ID, not a compute.service.Instance, so that it can be called by compute.monitor. """ - return [0L, 0L, 0L, 0L, null] + return [0L, 0L, 0L, 0L, None] def interface_stats(self, instance_name, iface_id): """ diff --git a/nova/virt/libvirt_conn.py b/nova/virt/libvirt_conn.py index e1a0a6f29..2bb96f819 100644 --- a/nova/virt/libvirt_conn.py +++ b/nova/virt/libvirt_conn.py @@ -1008,7 +1008,18 @@ class LibvirtConnection(driver.ComputeDriver): """ - return self._conn.getVersion() + # NOTE(justinsb): getVersion moved between libvirt versions + # Trying to do be compatible with older versions is a lost cause + # But ... we can at least give the user a nice message + method = getattr(self._conn, 'getVersion', None) + if method is None: + raise exception.Error(_("libvirt version is too old" + " (does not support getVersion)")) + # NOTE(justinsb): If we wanted to get the version, we could: + # method = getattr(libvirt, 'getVersion', None) + # NOTE(justinsb): This would then rely on a proper version check + + return method() def get_cpu_info(self): """Get cpuinfo information. |
