diff options
author | Zuul <zuul@review.opendev.org> | 2022-01-13 11:56:30 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2022-01-13 11:56:30 +0000 |
commit | 49fa39f41ec773e3a8fc129258d90d524325f0a7 (patch) | |
tree | 3e3563d25fca01db82dc2a6c62f138e7b2429382 | |
parent | 39f38705cda426e69063b8a0e8f3b8619cc275b6 (diff) | |
parent | 5385e013274917b3bc7edb54363d3da5644f1996 (diff) | |
download | ironic-49fa39f41ec773e3a8fc129258d90d524325f0a7.tar.gz |
Merge "Ensure 'port' is up2date after binding:host_id" into stable/wallaby
-rw-r--r-- | ironic/common/neutron.py | 3 | ||||
-rw-r--r-- | ironic/tests/unit/common/test_neutron.py | 5 | ||||
-rw-r--r-- | releasenotes/notes/fix-ipv6-provisioning-routed-provider-network-bbd0c46559f618ac.yaml | 6 |
3 files changed, 13 insertions, 1 deletions
diff --git a/ironic/common/neutron.py b/ironic/common/neutron.py index 03e78ef35..a0f24d1d0 100644 --- a/ironic/common/neutron.py +++ b/ironic/common/neutron.py @@ -345,7 +345,8 @@ def add_ports_to_network(task, network_uuid, security_groups=None): wait_for_host_agent( client, update_port_attrs['binding:host_id']) port = client.create_port(**port_attrs) - update_neutron_port(task.context, port.id, update_port_attrs) + port = update_neutron_port(task.context, port.id, + update_port_attrs) if CONF.neutron.dhcpv6_stateful_address_count > 1: _add_ip_addresses_for_ipv6_stateful(task.context, port, client) if is_smart_nic: diff --git a/ironic/tests/unit/common/test_neutron.py b/ironic/tests/unit/common/test_neutron.py index 900049df6..7dc67ab32 100644 --- a/ironic/tests/unit/common/test_neutron.py +++ b/ironic/tests/unit/common/test_neutron.py @@ -290,11 +290,13 @@ class TestNeutronNetworkActions(db_base.DbTestCase): fixed_ips=[]) self.client_mock.create_port.side_effect = [self.neutron_port, neutron_port2] + update_mock.side_effect = [self.neutron_port, neutron_port2] expected = {port.uuid: self.neutron_port.id, port2.uuid: neutron_port2.id} else: self.client_mock.create_port.return_value = self.neutron_port + update_mock.return_value = self.neutron_port expected = {port.uuid: self.neutron_port['id']} with task_manager.acquire(self.context, self.node.uuid) as task: @@ -458,6 +460,7 @@ class TestNeutronNetworkActions(db_base.DbTestCase): vpi_mock.return_value = True # Ensure we can create ports self.client_mock.create_port.return_value = self.neutron_port + update_mock.return_value = self.neutron_port expected = {port.uuid: self.neutron_port.id} with task_manager.acquire(self.context, self.node.uuid) as task: ports = neutron.add_ports_to_network(task, self.network_uuid) @@ -492,6 +495,7 @@ class TestNeutronNetworkActions(db_base.DbTestCase): ) self.client_mock.create_port.side_effect = [ self.neutron_port, openstack_exc.OpenStackCloudException] + update_mock.return_value = self.neutron_port with task_manager.acquire(self.context, self.node.uuid) as task: neutron.add_ports_to_network(task, self.network_uuid) self.assertIn("Could not create neutron port for node's", @@ -999,6 +1003,7 @@ class TestNeutronNetworkActions(db_base.DbTestCase): # Ensure we can create ports self.client_mock.create_port.return_value = self.neutron_port + update_mock.return_value = self.neutron_port expected = {port.uuid: self.neutron_port.id} with task_manager.acquire(self.context, self.node.uuid) as task: ports = neutron.add_ports_to_network(task, self.network_uuid) diff --git a/releasenotes/notes/fix-ipv6-provisioning-routed-provider-network-bbd0c46559f618ac.yaml b/releasenotes/notes/fix-ipv6-provisioning-routed-provider-network-bbd0c46559f618ac.yaml new file mode 100644 index 000000000..beb270f61 --- /dev/null +++ b/releasenotes/notes/fix-ipv6-provisioning-routed-provider-network-bbd0c46559f618ac.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixed an issue where provisioning/cleaning would fail on IPv6 routed provider + networks. See bug: + `2009773 <https://storyboard.openstack.org/#!/story/2009773>`_. |