diff options
| author | Eldar Nugaev <enugaev@griddynamics.com> | 2011-04-21 18:21:31 +0000 |
|---|---|---|
| committer | Tarmac <> | 2011-04-21 18:21:31 +0000 |
| commit | e86d276ec16862e7aff2de9b02ec4c0d1f976921 (patch) | |
| tree | 88cc8303c6aa0e36cc43fc898cf92d5871ad6cb4 /nova | |
| parent | c796920198305e101c75bcbf4e027ba9e81975d7 (diff) | |
| parent | 783cea4dc4497176b57b7a718a29bde102fb92bc (diff) | |
Fixed network_info creation in libvirt driver. Now creating same dict as in xenapi driver.
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/tests/test_virt.py | 6 | ||||
| -rw-r--r-- | nova/virt/libvirt_conn.py | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/nova/tests/test_virt.py b/nova/tests/test_virt.py index aeaea91c7..0a0c7a958 100644 --- a/nova/tests/test_virt.py +++ b/nova/tests/test_virt.py @@ -618,7 +618,8 @@ class IptablesFirewallTestCase(test.TestCase): instance_ref = db.instance_create(self.context, {'user_id': 'fake', 'project_id': 'fake', - 'mac_address': '56:12:12:12:12:12'}) + 'mac_address': '56:12:12:12:12:12', + 'instance_type_id': 1}) ip = '10.11.12.13' network_ref = db.project_get_network(self.context, @@ -841,7 +842,8 @@ class NWFilterTestCase(test.TestCase): instance_ref = db.instance_create(self.context, {'user_id': 'fake', 'project_id': 'fake', - 'mac_address': '00:A0:C9:14:C8:29'}) + 'mac_address': '00:A0:C9:14:C8:29', + 'instance_type_id': 1}) inst_id = instance_ref['id'] ip = '10.11.12.13' diff --git a/nova/virt/libvirt_conn.py b/nova/virt/libvirt_conn.py index d212be3c9..a42433fed 100644 --- a/nova/virt/libvirt_conn.py +++ b/nova/virt/libvirt_conn.py @@ -165,9 +165,10 @@ def _get_network_info(instance): ip_addresses = db.fixed_ip_get_all_by_instance(admin_context, instance['id']) - networks = db.network_get_all_by_instance(admin_context, instance['id']) + flavor = db.instance_type_get_by_id(admin_context, + instance['instance_type_id']) network_info = [] for network in networks: @@ -191,7 +192,9 @@ def _get_network_info(instance): mapping = { 'label': network['label'], 'gateway': network['gateway'], + 'broadcast': network['broadcast'], 'mac': instance['mac_address'], + 'rxtx_cap': flavor['rxtx_cap'], 'dns': [network['dns']], 'ips': [ip_dict(ip) for ip in network_ips]} |
