[Neutron] Support `uplink-status-propagation-updatable` extension
				
					
				
			Added ``--enable-uplink-status-propagation`` option and ``--disable-uplink-status-propagation`` option to ``port update`` command. Now the Neutron extension "uplink-status-propagation-updatable" allows to update the related value in a port. That was implemented in the following patches (during 2025.1 Epoxy release): * https://review.opendev.org/c/openstack/neutron-lib/+/927820 * https://review.opendev.org/c/openstack/neutron-lib/+/936234 * https://review.opendev.org/c/openstack/neutron/+/931641 Related-Bug: #1722720 Change-Id: I99cdcf21438d6d85092c995b50cb10b26ae7c059
This commit is contained in:
		 Rodolfo Alonso Hernandez
					Rodolfo Alonso Hernandez
				
			
				
					committed by
					
						 Rodolfo Alonso
						Rodolfo Alonso
					
				
			
			
				
	
			
			
			 Rodolfo Alonso
						Rodolfo Alonso
					
				
			
						parent
						
							b50ac8d2a2
						
					
				
				
					commit
					426abbdc68
				
			| @@ -1102,6 +1102,18 @@ class SetPort(common.NeutronCommandWithExtraArgs): | |||||||
|                 "(requires data plane status extension)" |                 "(requires data plane status extension)" | ||||||
|             ), |             ), | ||||||
|         ) |         ) | ||||||
|  |         uplink_status_group = parser.add_mutually_exclusive_group() | ||||||
|  |         uplink_status_group.add_argument( | ||||||
|  |             '--enable-uplink-status-propagation', | ||||||
|  |             action='store_true', | ||||||
|  |             help=_('Enable uplink status propagation'), | ||||||
|  |         ) | ||||||
|  |         uplink_status_group.add_argument( | ||||||
|  |             '--disable-uplink-status-propagation', | ||||||
|  |             action='store_true', | ||||||
|  |             help=_('Disable uplink status propagation'), | ||||||
|  |         ) | ||||||
|  |  | ||||||
|         _tag.add_tag_option_to_parser_for_set(parser, _('port')) |         _tag.add_tag_option_to_parser_for_set(parser, _('port')) | ||||||
|  |  | ||||||
|         return parser |         return parser | ||||||
|   | |||||||
| @@ -2633,6 +2633,35 @@ class TestSetPort(TestPort): | |||||||
|     def test_set_trusted_false(self): |     def test_set_trusted_false(self): | ||||||
|         self._test_set_trusted_field(False) |         self._test_set_trusted_field(False) | ||||||
|  |  | ||||||
|  |     def _test_set_uplink_status_propagation(self, uspropagation): | ||||||
|  |         arglist = [self._port.id] | ||||||
|  |         if uspropagation: | ||||||
|  |             arglist += ['--enable-uplink-status-propagation'] | ||||||
|  |         else: | ||||||
|  |             arglist += ['--disable-uplink-status-propagation'] | ||||||
|  |  | ||||||
|  |         verifylist = [ | ||||||
|  |             ('port', self._port.id), | ||||||
|  |         ] | ||||||
|  |         if uspropagation: | ||||||
|  |             verifylist.append(('enable_uplink_status_propagation', True)) | ||||||
|  |         else: | ||||||
|  |             verifylist.append(('enable_uplink_status_propagation', False)) | ||||||
|  |  | ||||||
|  |         parsed_args = self.check_parser(self.cmd, arglist, verifylist) | ||||||
|  |  | ||||||
|  |         result = self.cmd.take_action(parsed_args) | ||||||
|  |         self.network_client.update_port.assert_called_once_with( | ||||||
|  |             self._port, **{'propagate_uplink_status': uspropagation} | ||||||
|  |         ) | ||||||
|  |         self.assertIsNone(result) | ||||||
|  |  | ||||||
|  |     def test_set_uplink_status_propagation_true(self): | ||||||
|  |         self._test_set_uplink_status_propagation(True) | ||||||
|  |  | ||||||
|  |     def test_set_uplink_status_propagation_false(self): | ||||||
|  |         self._test_set_uplink_status_propagation(False) | ||||||
|  |  | ||||||
|  |  | ||||||
| class TestShowPort(TestPort): | class TestShowPort(TestPort): | ||||||
|     # The port to show. |     # The port to show. | ||||||
|   | |||||||
| @@ -0,0 +1,5 @@ | |||||||
|  | --- | ||||||
|  | features: | ||||||
|  |   - | | ||||||
|  |     Add ``--enable-uplink-status-propagation`` option and | ||||||
|  |     ``--disable-uplink-status-propagation`` option to ``port update`` command. | ||||||
		Reference in New Issue
	
	Block a user