diff options
| author | Dan Prince <dan.prince@rackspace.com> | 2011-05-02 19:26:06 +0000 |
|---|---|---|
| committer | Tarmac <> | 2011-05-02 19:26:06 +0000 |
| commit | 65f05c403e852cebeb7b052e36bbd129aedf4d4f (patch) | |
| tree | a68d2263bdd4b4e365e78b0e2cdb1ce9ac76a5ce | |
| parent | 46fc9dccf2d8666e6b64ad060b1deb4c3c591768 (diff) | |
| parent | 3be272f432b4385cf77787416762a360687a36bd (diff) | |
| download | nova-65f05c403e852cebeb7b052e36bbd129aedf4d4f.tar.gz nova-65f05c403e852cebeb7b052e36bbd129aedf4d4f.tar.xz nova-65f05c403e852cebeb7b052e36bbd129aedf4d4f.zip | |
Implement get_host_ip_addr in the libvirt compute driver.
| -rw-r--r-- | nova/tests/test_virt.py | 5 | ||||
| -rw-r--r-- | nova/virt/libvirt_conn.py | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/nova/tests/test_virt.py b/nova/tests/test_virt.py index 47432baef..1311ba361 100644 --- a/nova/tests/test_virt.py +++ b/nova/tests/test_virt.py @@ -646,6 +646,11 @@ class LibvirtConnTestCase(test.TestCase): self.assertTrue(count) + def test_get_host_ip_addr(self): + conn = libvirt_conn.LibvirtConnection(False) + ip = conn.get_host_ip_addr() + self.assertEquals(ip, FLAGS.my_ip) + def tearDown(self): self.manager.delete_project(self.project) self.manager.delete_user(self.user) diff --git a/nova/virt/libvirt_conn.py b/nova/virt/libvirt_conn.py index 46643ce73..9780c69a6 100644 --- a/nova/virt/libvirt_conn.py +++ b/nova/virt/libvirt_conn.py @@ -735,6 +735,9 @@ class LibvirtConnection(driver.ComputeDriver): subprocess.Popen(cmd, shell=True) return {'token': token, 'host': host, 'port': port} + def get_host_ip_addr(self): + return FLAGS.my_ip + @exception.wrap_exception def get_vnc_console(self, instance): def get_vnc_port_for_instance(instance_name): |
