Merge "[Neutron] Support `uplink-status-propagation-updatable
` extension"
This commit is contained in:
commit
d22b7732ad
@ -1103,6 +1103,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.
|
Loading…
x
Reference in New Issue
Block a user