diff options
| author | Rodolfo Alonso Hernandez <ralonsoh@redhat.com> | 2020-07-10 13:14:26 +0000 |
|---|---|---|
| committer | Rodolfo Alonso Hernandez <ralonsoh@redhat.com> | 2020-07-31 15:18:55 +0000 |
| commit | 454b2195649aec1a9eb1fdaa60b64663cb1f7298 (patch) | |
| tree | cb2118ff55ca2a3e4a760ece9f661fbf507e1167 /openstackclient/network/v2 | |
| parent | 4e2aefb5fa2ce236473187650149cf421c5f8c53 (diff) | |
| download | python-openstackclient-454b2195649aec1a9eb1fdaa60b64663cb1f7298.tar.gz | |
Add NUMA affinity policy parameter to "port"
Added port NUMA affinity policy parameter to "port create",
"port set" and "port unset" commands.
Change-Id: I48cacab275856af2911829f9b7176bb87fd039b3
Related-Bug: #1886798
Diffstat (limited to 'openstackclient/network/v2')
| -rw-r--r-- | openstackclient/network/v2/port.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/openstackclient/network/v2/port.py b/openstackclient/network/v2/port.py index a21324ae..8ea1077a 100644 --- a/openstackclient/network/v2/port.py +++ b/openstackclient/network/v2/port.py @@ -158,6 +158,16 @@ def _get_attrs(client_manager, parsed_args): parsed_args.disable_uplink_status_propagation): attrs['propagate_uplink_status'] = False + if ('numa_policy_required' in parsed_args and + parsed_args.numa_policy_required): + attrs['numa_affinity_policy'] = 'required' + elif ('numa_policy_preferred' in parsed_args and + parsed_args.numa_policy_preferred): + attrs['numa_affinity_policy'] = 'preferred' + elif ('numa_policy_legacy' in parsed_args and + parsed_args.numa_policy_legacy): + attrs['numa_affinity_policy'] = 'legacy' + return attrs @@ -265,6 +275,22 @@ def _add_updatable_args(parser): help=_("Set DNS name for this port " "(requires DNS integration extension)") ) + numa_affinity_policy_group = parser.add_mutually_exclusive_group() + numa_affinity_policy_group.add_argument( + '--numa-policy-required', + action='store_true', + help=_("NUMA affinity policy required to schedule this port") + ) + numa_affinity_policy_group.add_argument( + '--numa-policy-preferred', + action='store_true', + help=_("NUMA affinity policy preferred to schedule this port") + ) + numa_affinity_policy_group.add_argument( + '--numa-policy-legacy', + action='store_true', + help=_("NUMA affinity policy using legacy mode to schedule this port") + ) # TODO(abhiraut): Use the SDK resource mapped attribute names once the @@ -904,6 +930,11 @@ class UnsetPort(command.Command): action='store_true', help=_("Clear existing information of data plane status") ) + parser.add_argument( + '--numa-policy', + action='store_true', + help=_("Clear existing NUMA affinity policy") + ) _tag.add_tag_option_to_parser_for_unset(parser, _('port')) @@ -959,6 +990,8 @@ class UnsetPort(command.Command): attrs['qos_policy_id'] = None if parsed_args.data_plane_status: attrs['data_plane_status'] = None + if parsed_args.numa_policy: + attrs['numa_affinity_policy'] = None if attrs: client.update_port(obj, **attrs) |
