From 995ced9e78d15a6d2459215a28a9d950cdd8637a Mon Sep 17 00:00:00 2001 From: Joseph Richard Date: Tue, 25 Sep 2018 14:59:36 -0400 Subject: [PATCH] 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 --- .../centos/build_srpm.data | 2 +- ...wrs-binding-vif_model-using-osclient.patch | 23 +++++++ .../centos/meta_patches/PATCH_ORDER | 1 + ...wrs-binding-vif_model-using-osclient.patch | 64 +++++++++++++++++++ 4 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 openstack/python-openstackclient/centos/meta_patches/0016-Allow-setting-wrs-binding-vif_model-using-osclient.patch create mode 100644 openstack/python-openstackclient/centos/patches/0001-Allow-setting-wrs-binding-vif_model-using-osclient.patch diff --git a/openstack/python-openstackclient/centos/build_srpm.data b/openstack/python-openstackclient/centos/build_srpm.data index 922ab862..c1f01e47 100644 --- a/openstack/python-openstackclient/centos/build_srpm.data +++ b/openstack/python-openstackclient/centos/build_srpm.data @@ -1 +1 @@ -TIS_PATCH_VER=17 +TIS_PATCH_VER=18 diff --git a/openstack/python-openstackclient/centos/meta_patches/0016-Allow-setting-wrs-binding-vif_model-using-osclient.patch b/openstack/python-openstackclient/centos/meta_patches/0016-Allow-setting-wrs-binding-vif_model-using-osclient.patch new file mode 100644 index 00000000..0c48f53e --- /dev/null +++ b/openstack/python-openstackclient/centos/meta_patches/0016-Allow-setting-wrs-binding-vif_model-using-osclient.patch @@ -0,0 +1,23 @@ +From 15a676bb74150546db8425ecae4976fb773661a0 Mon Sep 17 00:00:00 2001 +From: Joseph Richard +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 diff --git a/openstack/python-openstackclient/centos/meta_patches/PATCH_ORDER b/openstack/python-openstackclient/centos/meta_patches/PATCH_ORDER index 1e85e389..ab186ece 100644 --- a/openstack/python-openstackclient/centos/meta_patches/PATCH_ORDER +++ b/openstack/python-openstackclient/centos/meta_patches/PATCH_ORDER @@ -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 diff --git a/openstack/python-openstackclient/centos/patches/0001-Allow-setting-wrs-binding-vif_model-using-osclient.patch b/openstack/python-openstackclient/centos/patches/0001-Allow-setting-wrs-binding-vif_model-using-osclient.patch new file mode 100644 index 00000000..ae4bc2e5 --- /dev/null +++ b/openstack/python-openstackclient/centos/patches/0001-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 +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=[,mac-address=] " + "(repeat option to set multiple allowed-address pairs)") + ) ++ port_security.add_argument( ++ '--wrs-binding:vif_model', ++ dest='wrs_vif_model', ++ metavar='', ++ 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='', ++ 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