Allow setting wrs-binding:vif_model using osclient
This commit adds support for setting wrs-binding:vif_model using osclient. The syntax is openstack port create --wrs-binding:vif_model VIF_MODEL. Change-Id: Ifb0abe0a02c382535b0073effc66d04ad38816eb Closes-Bug: 1791127 Signed-off-by: Joseph Richard <Joseph.Richard@windriver.com>
This commit is contained in:
parent
f77c2e1146
commit
995ced9e78
@ -1 +1 @@
|
||||
TIS_PATCH_VER=17
|
||||
TIS_PATCH_VER=18
|
||||
|
@ -0,0 +1,23 @@
|
||||
From 15a676bb74150546db8425ecae4976fb773661a0 Mon Sep 17 00:00:00 2001
|
||||
From: Joseph Richard <Joseph.Richard@windriver.com>
|
||||
Date: Tue, 25 Sep 2018 14:57:06 -0400
|
||||
Subject: [PATCH 16/16] Allow setting wrs-binding:vif_model using osclient
|
||||
|
||||
---
|
||||
SPECS/python-openstackclient.spec | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/SPECS/python-openstackclient.spec b/SPECS/python-openstackclient.spec
|
||||
index c192b2b..29fec53 100644
|
||||
--- a/SPECS/python-openstackclient.spec
|
||||
+++ b/SPECS/python-openstackclient.spec
|
||||
@@ -29,6 +29,7 @@ Patch0008: 0002-US106901-Openstack-CLI-Adoption.patch
|
||||
Patch0009: 0001-Optimize-getting-endpoint-list.patch
|
||||
Patch0010: 0002-Add-support-for-endpoing-filter-commands.patch
|
||||
Patch0011: 0003-Add-support-for-endpoint-group-commands.patch
|
||||
+Patch0012: 0001-Allow-setting-wrs-binding-vif_model-using-osclient.patch
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
--
|
||||
1.8.3.1
|
@ -13,3 +13,4 @@
|
||||
0001-meta-US106901-Openstack-CLI-Adoption.patch
|
||||
0002-meta-US106901-Openstack-CLI-Adoption.patch
|
||||
1003-meta-patch-for-endpoint-groups.patch
|
||||
0016-Allow-setting-wrs-binding-vif_model-using-osclient.patch
|
||||
|
@ -0,0 +1,64 @@
|
||||
From 405e39f8a77c7f33dda80b2681ff53407b2aa256 Mon Sep 17 00:00:00 2001
|
||||
From: rpm-build <rpm-build>
|
||||
Date: Tue, 25 Sep 2018 14:53:18 -0400
|
||||
Subject: [PATCH] Allow setting wrs-binding:vif_model using osclient
|
||||
|
||||
---
|
||||
openstackclient/network/v2/port.py | 21 +++++++++++++++++++++
|
||||
1 file changed, 21 insertions(+)
|
||||
|
||||
diff --git a/openstackclient/network/v2/port.py b/openstackclient/network/v2/port.py
|
||||
index 4a29daf..22cba16 100644
|
||||
--- a/openstackclient/network/v2/port.py
|
||||
+++ b/openstackclient/network/v2/port.py
|
||||
@@ -389,6 +389,12 @@ class CreatePort(command.ShowOne):
|
||||
"ip-address=<ip-address>[,mac-address=<mac-address>] "
|
||||
"(repeat option to set multiple allowed-address pairs)")
|
||||
)
|
||||
+ port_security.add_argument(
|
||||
+ '--wrs-binding:vif_model',
|
||||
+ dest='wrs_vif_model',
|
||||
+ metavar='<wrs_vif_model>',
|
||||
+ help=_("Set wrs-binding:vif_model for this port")
|
||||
+ )
|
||||
_tag.add_tag_option_to_parser_for_create(parser, _('port'))
|
||||
return parser
|
||||
|
||||
@@ -421,6 +427,11 @@ class CreatePort(command.ShowOne):
|
||||
if parsed_args.qos_policy:
|
||||
attrs['qos_policy_id'] = client.find_qos_policy(
|
||||
parsed_args.qos_policy, ignore_missing=False).id
|
||||
+
|
||||
+ if parsed_args.wrs_vif_model:
|
||||
+ attrs['wrs-binding:vif_model'] = parsed_args.wrs_vif_model
|
||||
+
|
||||
+
|
||||
obj = client.create_port(**attrs)
|
||||
# tags cannot be set when created, so tags need to be set later.
|
||||
_tag.update_tags_for_set(client, obj, parsed_args)
|
||||
@@ -705,6 +716,13 @@ class SetPort(command.Command):
|
||||
"Unset it to None with the 'port unset' command "
|
||||
"(requires data plane status extension)")
|
||||
)
|
||||
+ port_security.add_argument(
|
||||
+ '--wrs-binding:vif_model',
|
||||
+ dest='wrs_vif_model',
|
||||
+ metavar='<wrs_vif_model>',
|
||||
+ help=_("Set wrs-binding:vif_model for this port")
|
||||
+ )
|
||||
+
|
||||
_tag.add_tag_option_to_parser_for_set(parser, _('port'))
|
||||
|
||||
return parser
|
||||
@@ -762,6 +780,9 @@ class SetPort(command.Command):
|
||||
if parsed_args.data_plane_status:
|
||||
attrs['data_plane_status'] = parsed_args.data_plane_status
|
||||
|
||||
+ if parsed_args.wrs_vif_model:
|
||||
+ attrs['wrs-binding:vif_model'] = parsed_args.wrs_vif_model
|
||||
+
|
||||
if attrs:
|
||||
client.update_port(obj, **attrs)
|
||||
|
||||
--
|
||||
1.8.3.1
|
Loading…
x
Reference in New Issue
Block a user