Don't include host_routes when creating a IPv6 subnet
This wasn't include in the bash version and was incorrecly added when it was converted to python in I0168991a0fbd9dacf708ba2bdbc13248414affbe Closes-Bug: #1754681 Change-Id: I41e37346122b0acaffb72fad34519e9e9828f61e
This commit is contained in:
parent
142d131aad
commit
90ea5f2b92
@ -2046,12 +2046,10 @@ def _neutron_subnet_create(sdk, network_id, cidr, gateway, host_routes,
|
|||||||
try:
|
try:
|
||||||
# DHCP_START contains a ":" then assume a IPv6 subnet
|
# DHCP_START contains a ":" then assume a IPv6 subnet
|
||||||
if ':' in allocation_pool[0]['start']:
|
if ':' in allocation_pool[0]['start']:
|
||||||
host_routes = ''
|
|
||||||
subnet = sdk.network.create_subnet(
|
subnet = sdk.network.create_subnet(
|
||||||
name=name,
|
name=name,
|
||||||
cidr=cidr,
|
cidr=cidr,
|
||||||
gateway_ip=gateway,
|
gateway_ip=gateway,
|
||||||
host_routes=host_routes,
|
|
||||||
enable_dhcp=True,
|
enable_dhcp=True,
|
||||||
ip_version='6',
|
ip_version='6',
|
||||||
ipv6_address_mode='dhcpv6-stateless',
|
ipv6_address_mode='dhcpv6-stateless',
|
||||||
@ -2080,16 +2078,14 @@ def _neutron_subnet_create(sdk, network_id, cidr, gateway, host_routes,
|
|||||||
|
|
||||||
def _neutron_subnet_update(sdk, subnet_id, gateway, host_routes,
|
def _neutron_subnet_update(sdk, subnet_id, gateway, host_routes,
|
||||||
allocation_pool, name):
|
allocation_pool, name):
|
||||||
|
update_values = {'name': name, 'gateway_ip': gateway,
|
||||||
|
'host_routes': host_routes,
|
||||||
|
'allocation_pools': allocation_pool}
|
||||||
try:
|
try:
|
||||||
# DHCP_START contains a ":" then assume a IPv6 subnet
|
# DHCP_START contains a ":" then assume a IPv6 subnet
|
||||||
if ':' in allocation_pool[0]['start']:
|
if ':' in allocation_pool[0]['start']:
|
||||||
host_routes = ''
|
del update_values['host_routes']
|
||||||
subnet = sdk.network.update_subnet(
|
subnet = sdk.network.update_subnet(subnet_id, **update_values)
|
||||||
subnet_id,
|
|
||||||
name=name,
|
|
||||||
gateway_ip=gateway,
|
|
||||||
host_routes=host_routes,
|
|
||||||
allocation_pools=allocation_pool)
|
|
||||||
LOG.info("Subnet updated %s", subnet)
|
LOG.info("Subnet updated %s", subnet)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.error("Update subnet %s failed: %s", name, e)
|
LOG.error("Update subnet %s failed: %s", name, e)
|
||||||
|
Loading…
Reference in New Issue
Block a user