Comment 1 for bug 1955417

Revision history for this message
Harald Jensås (harald-jensas) wrote :

Chaging the gateway also fail:
 +gateway = 2405:200:81c:391:61::25
 -gateway = 2405:200:81c:391:61::15

Neutron change https://review.opendev.org/c/openstack/neutron/+/822098 addresses the non-changing address issue. But seems we need to handle this in case the address is changed.

>>> subnet = conn.network.find_subnet('ctlplane-subnet')
>>> subnet
openstack.network.v2.subnet.Subnet(id=3658699f-b165-48d9-b92c-214c5eb353e4, name=ctlplane-subnet, tenant_id=2e4b5681eea34176be0d3d9fcebadee3, network_id=c285d079-6983-4fb1-9ad3-244855f068f8, ip_version=6, subnetpool_id=None, enable_dhcp=True, ipv6_ra_mode=dhcpv6-stateful, ipv6_address_mode=dhcpv6-stateful, gateway_ip=2405:200:81c:391:61::15, cidr=2405:200:81c:391::/64, allocation_pools=[{'start': '2405:200:81c:391:61::100', 'end': '2405:200:81c:391:61::4ff'}], host_routes=[], dns_nameservers=[], description=, service_types=[], segment_id=None, tags=[], created_at=2021-12-20T11:22:51Z, updated_at=2021-12-20T12:16:54Z, revision_number=1, location=Munch({'cloud': 'undercloud', 'region_name': 'regionOne', 'zone': None, 'project': Munch({'id': '2e4b5681eea34176be0d3d9fcebadee3', 'name': 'admin', 'domain_id': None, 'domain_name': 'Default'})}))
>>> conn.network.update_subnet(subnet.id, name=subnet.name, gateway_ip='2405:200:81c:391:61::25', allocation_pools=subnet.allocation_pools, dns_nameservers=subnet.dns_nameservers)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.6/site-packages/openstack/network/v2/_proxy.py", line 3469, in update_subnet
    return self._update(_subnet.Subnet, subnet, **attrs)
  File "/usr/lib/python3.6/site-packages/openstack/proxy.py", line 46, in check
    return method(self, expected, actual, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/openstack/proxy.py", line 393, in _update
    return res.commit(self, base_path=base_path)
  File "/usr/lib/python3.6/site-packages/openstack/resource.py", line 1402, in commit
    retry_on_conflict=retry_on_conflict)
  File "/usr/lib/python3.6/site-packages/openstack/resource.py", line 1428, in _commit
    self._translate_response(response, has_body=has_body)
  File "/usr/lib/python3.6/site-packages/openstack/resource.py", line 1107, in _translate_response
    exceptions.raise_from_response(response, error_message=error_message)
  File "/usr/lib/python3.6/site-packages/openstack/exceptions.py", line 229, in raise_from_response
    http_status=http_status, request_id=request_id
openstack.exceptions.ConflictException: ConflictException: 409: Client Error for url: https://[2405:200:81c:391:61::13]:13696/v2.0/subnets/3658699f-b165-48d9-b92c-214c5eb353e4, Current gateway ip 2405:200:81c:391:61::15 already in use by port cd604908-93eb-4c9b-a42a-c93eafd15a1a. Unable to update.