diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-05-04 04:20:08 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-05-04 04:20:08 +0000 |
| commit | 45c07fcb7ba5434d84803442497cd6bb47284dcf (patch) | |
| tree | ceb08b2ddb7e647b63a9d0b62a6d4c73813ecb1f | |
| parent | 6c3763b0629bde303f778c12258610894e18c89c (diff) | |
| parent | 005b9950ac84bf3ae06c24ee018f192064060428 (diff) | |
| download | nova-45c07fcb7ba5434d84803442497cd6bb47284dcf.tar.gz nova-45c07fcb7ba5434d84803442497cd6bb47284dcf.tar.xz nova-45c07fcb7ba5434d84803442497cd6bb47284dcf.zip | |
Merge "Being more defensive around the use_ipv6 config option"
| -rw-r--r-- | nova/virt/netutils.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/nova/virt/netutils.py b/nova/virt/netutils.py index 1277251b5..d38197948 100644 --- a/nova/virt/netutils.py +++ b/nova/virt/netutils.py @@ -90,7 +90,8 @@ def get_injected_network_template(network_info, use_ipv6=CONF.use_ipv6, address_v6 = None gateway_v6 = None netmask_v6 = None - if use_ipv6: + ipv6_is_available = use_ipv6 and 'ip6s' in mapping + if ipv6_is_available: address_v6 = mapping['ip6s'][0]['ip'] netmask_v6 = mapping['ip6s'][0]['netmask'] gateway_v6 = mapping['gateway_v6'] @@ -116,4 +117,4 @@ def get_injected_network_template(network_info, use_ipv6=CONF.use_ipv6, ifc_template = open(template).read() return str(Template(ifc_template, searchList=[{'interfaces': nets, - 'use_ipv6': use_ipv6}])) + 'use_ipv6': ipv6_is_available}])) |
