Skip to content

Commit

Permalink
use name gateway_v6 instead of gateway6
Browse files Browse the repository at this point in the history
fixes bug #890099

Change-Id: I2b516c4b41d387846f8edb9a7b82f3016f0e0eac
  • Loading branch information
hudayou committed Jan 3, 2012
1 parent ea21fe6 commit a8fd6bf
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 20 deletions.
1 change: 1 addition & 0 deletions Authors
Expand Up @@ -53,6 +53,7 @@ François Charlier <francois.charlier@enovance.com>
Gabe Westmaas <gabe.westmaas@rackspace.com>
Gary Kotton <garyk@radware.com>
Gaurav Gupta <gaurav@denali-systems.com>
Hengqing Hu <hudayou@hotmail.com>
Hisaharu Ishii <ishii.hisaharu@lab.ntt.co.jp>
Hisaki Ohara <hisaki.ohara@intel.com>
Ilya Alekseyev <ilyaalekseyev@acm.org>
Expand Down
2 changes: 1 addition & 1 deletion nova/network/manager.py
Expand Up @@ -766,7 +766,7 @@ def rxtx_cap(instance_type, network):
info['ip6s'] = [ip6_dict()]
# TODO(tr3buchet): handle ip6 routes here as well
if network['gateway_v6']:
info['gateway6'] = network['gateway_v6']
info['gateway_v6'] = network['gateway_v6']
if network['dns1']:
info['dns'].append(network['dns1'])
if network['dns2']:
Expand Down
2 changes: 1 addition & 1 deletion nova/network/quantum/manager.py
Expand Up @@ -456,7 +456,7 @@ def ip_dict(ip, subnet):
info['ip6s'] = [ip_dict(ip, v6_subnet) for ip in v6_ips]

if v6_subnet['gateway']:
info['gateway6'] = v6_subnet['gateway']
info['gateway_v6'] = v6_subnet['gateway']

dns_dict = {}
for s in [v4_subnet, v6_subnet]:
Expand Down
2 changes: 1 addition & 1 deletion nova/tests/test_network.py
Expand Up @@ -168,7 +168,7 @@ def test_get_instance_nw_info(self):
'dhcp_server': '192.168.%d.1' % i,
'dns': ['192.168.%d.3' % n, '192.168.%d.4' % n],
'gateway': '192.168.%d.1' % i,
'gateway6': '2001:db8:0:%x::1' % i,
'gateway_v6': '2001:db8:0:%x::1' % i,
'ip6s': 'DONTCARE',
'ips': 'DONTCARE',
'label': 'test%d' % i,
Expand Down
2 changes: 1 addition & 1 deletion nova/tests/test_vmwareapi.py
Expand Up @@ -63,7 +63,7 @@ def setUp(self):
{'broadcast': '192.168.0.255',
'dns': ['192.168.0.1'],
'gateway': '192.168.0.1',
'gateway6': 'dead:beef::1',
'gateway_v6': 'dead:beef::1',
'ip6s': [{'enabled': '1',
'ip': 'dead:beef::dcad:beff:feef:0',
'netmask': '64'}],
Expand Down
14 changes: 7 additions & 7 deletions nova/tests/test_xenapi.py
Expand Up @@ -332,7 +332,7 @@ def check_vm_record(self, conn, check_injection=False):
{'broadcast': '192.168.0.255',
'dns': ['192.168.0.1'],
'gateway': '192.168.0.1',
'gateway6': 'dead:beef::1',
'gateway_v6': 'dead:beef::1',
'ip6s': [{'enabled': '1',
'ip': 'dead:beef::dcad:beff:feef:0',
'netmask': '64'}],
Expand Down Expand Up @@ -412,7 +412,7 @@ def _test_spawn(self, image_ref, kernel_id, ramdisk_id,
{'broadcast': '192.168.0.255',
'dns': ['192.168.0.1'],
'gateway': '192.168.0.1',
'gateway6': 'dead:beef::1',
'gateway_v6': 'dead:beef::1',
'ip6s': [{'enabled': '1',
'ip': 'dead:beef::dcad:beff:feef:0',
'netmask': '64'}],
Expand Down Expand Up @@ -688,7 +688,7 @@ def _create_instance(self, instance_id=1, spawn=True):
{'broadcast': '192.168.0.255',
'dns': ['192.168.0.1'],
'gateway': '192.168.0.1',
'gateway6': 'dead:beef::1',
'gateway_v6': 'dead:beef::1',
'ip6s': [{'enabled': '1',
'ip': 'dead:beef::dcad:beff:feef:0',
'netmask': '64'}],
Expand Down Expand Up @@ -858,7 +858,7 @@ def fake_finish_revert_migration(*args, **kwargs):
{'broadcast': '192.168.0.255',
'dns': ['192.168.0.1'],
'gateway': '192.168.0.1',
'gateway6': 'dead:beef::1',
'gateway_v6': 'dead:beef::1',
'ip6s': [{'enabled': '1',
'ip': 'dead:beef::dcad:beff:feef:0',
'netmask': '64'}],
Expand Down Expand Up @@ -900,7 +900,7 @@ def fake_vdi_resize(*args, **kwargs):
{'broadcast': '192.168.0.255',
'dns': ['192.168.0.1'],
'gateway': '192.168.0.1',
'gateway6': 'dead:beef::1',
'gateway_v6': 'dead:beef::1',
'ip6s': [{'enabled': '1',
'ip': 'dead:beef::dcad:beff:feef:0',
'netmask': '64'}],
Expand Down Expand Up @@ -936,7 +936,7 @@ def fake_vdi_resize(*args, **kwargs):
{'broadcast': '192.168.0.255',
'dns': ['192.168.0.1'],
'gateway': '192.168.0.1',
'gateway6': 'dead:beef::1',
'gateway_v6': 'dead:beef::1',
'ip6s': [{'enabled': '1',
'ip': 'dead:beef::dcad:beff:feef:0',
'netmask': '64'}],
Expand Down Expand Up @@ -966,7 +966,7 @@ def fake_vdi_resize(*args, **kwargs):
{'broadcast': '192.168.0.255',
'dns': ['192.168.0.1'],
'gateway': '192.168.0.1',
'gateway6': 'dead:beef::1',
'gateway_v6': 'dead:beef::1',
'ip6s': [{'enabled': '1',
'ip': 'dead:beef::dcad:beff:feef:0',
'netmask': '64'}],
Expand Down
2 changes: 1 addition & 1 deletion nova/tests/utils.py
Expand Up @@ -83,7 +83,7 @@ def get_test_network_info(count=1):
mapping = {'mac': fake,
'dhcp_server': fake,
'gateway': fake,
'gateway6': fake,
'gateway_v6': fake,
'ips': [{'ip': fake_ip}, {'ip': fake_ip}]}
if ipv6:
mapping['ip6s'] = [{'ip': fake_ip},
Expand Down
4 changes: 2 additions & 2 deletions nova/virt/libvirt/connection.py
Expand Up @@ -1014,15 +1014,15 @@ def basepath(fname='', suffix=suffix):
if FLAGS.use_ipv6:
address_v6 = mapping['ip6s'][0]['ip']
netmask_v6 = mapping['ip6s'][0]['netmask']
gateway_v6 = mapping['gateway6']
gateway_v6 = mapping['gateway_v6']
net_info = {'name': 'eth%d' % ifc_num,
'address': address,
'netmask': netmask,
'gateway': mapping['gateway'],
'broadcast': mapping['broadcast'],
'dns': ' '.join(mapping['dns']),
'address_v6': address_v6,
'gateway6': gateway_v6,
'gateway_v6': gateway_v6,
'netmask_v6': netmask_v6}
nets.append(net_info)

Expand Down
4 changes: 2 additions & 2 deletions nova/virt/libvirt/firewall.py
Expand Up @@ -345,7 +345,7 @@ def prepare_instance_filter(self, instance, network_info):

if FLAGS.use_ipv6:
networks = [network for (network, info) in network_info if
info['gateway6']]
info['gateway_v6']]

if networks:
instance_secgroup_filter_children.\
Expand Down Expand Up @@ -634,7 +634,7 @@ def instance_rules(instance, network_info):
# they're not worth the clutter.
if FLAGS.use_ipv6:
# Allow RA responses
gateways_v6 = [mapping['gateway6'] for (_n, mapping) in
gateways_v6 = [mapping['gateway_v6'] for (_n, mapping) in
network_info]
for gateway_v6 in gateways_v6:
ipv6_rules.append(
Expand Down
6 changes: 3 additions & 3 deletions nova/virt/libvirt/vif.py
Expand Up @@ -41,7 +41,7 @@ class LibvirtBridgeDriver(VIFDriver):
def _get_configurations(self, network, mapping):
"""Get a dictionary of VIF configurations for bridge type."""
# Assume that the gateway also acts as the dhcp server.
gateway6 = mapping.get('gateway6')
gateway_v6 = mapping.get('gateway_v6')
mac_id = mapping['mac'].replace(':', '')

if FLAGS.allow_same_net_traffic:
Expand All @@ -67,8 +67,8 @@ def _get_configurations(self, network, mapping):
'extra_params': extra_params,
}

if gateway6:
result['gateway6'] = gateway6 + "/128"
if gateway_v6:
result['gateway_v6'] = gateway_v6 + "/128"

return result

Expand Down
2 changes: 1 addition & 1 deletion nova/virt/xenapi/vm_utils.py
Expand Up @@ -1527,7 +1527,7 @@ def _prepare_injectables(inst, networks_info):
'dns': dns,
'address_v6': ip_v6 and ip_v6['ip'] or '',
'netmask_v6': ip_v6 and ip_v6['netmask'] or '',
'gateway_v6': ip_v6 and info['gateway6'] or '',
'gateway_v6': ip_v6 and info['gateway_v6'] or '',
'use_ipv6': FLAGS.use_ipv6}
interfaces_info.append(interface_info)

Expand Down

0 comments on commit a8fd6bf

Please sign in to comment.