diff options
author | Slawek Kaplonski <skaplons@redhat.com> | 2021-11-23 21:56:56 +0100 |
---|---|---|
committer | Slawek Kaplonski <skaplons@redhat.com> | 2021-11-28 19:58:46 +0100 |
commit | f4629331134c40599f9baf908a391460b74d2767 (patch) | |
tree | a9e3f5636a670d55dd9a4fd88420c5662b707241 /openstackclient/network | |
parent | 8b394e564120984059d6424bb870c8da51a400e7 (diff) | |
download | python-openstackclient-f4629331134c40599f9baf908a391460b74d2767.tar.gz |
Allow unset port's host_id
It is supported by Neutron and needs to be done like that when e.g.
admin wants to unbound port from the host.
Task: #44043
Story: #2009705
Change-Id: I08f1bb40f4dc72cfa7c62feeb5f513455de0ca45
Diffstat (limited to 'openstackclient/network')
-rw-r--r-- | openstackclient/network/v2/port.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/openstackclient/network/v2/port.py b/openstackclient/network/v2/port.py index 132c384a..8f79b80b 100644 --- a/openstackclient/network/v2/port.py +++ b/openstackclient/network/v2/port.py @@ -969,6 +969,12 @@ class UnsetPort(common.NeutronUnsetCommandWithExtraArgs): action='store_true', help=_("Clear existing NUMA affinity policy") ) + parser.add_argument( + '--host', + action='store_true', + default=False, + help=_("Clear host binding for the port.") + ) _tag.add_tag_option_to_parser_for_unset(parser, _('port')) @@ -1026,6 +1032,8 @@ class UnsetPort(common.NeutronUnsetCommandWithExtraArgs): attrs['data_plane_status'] = None if parsed_args.numa_policy: attrs['numa_affinity_policy'] = None + if parsed_args.host: + attrs['binding:host_id'] = None attrs.update( self._parse_extra_properties(parsed_args.extra_properties)) |