Remove custom extension from stx-python-openstackclient

Remove WRS mac_filtering and setting extension

Story: 2003946
Task: 27751

Change-Id: I14e8a267dfcc9a1daa882bd458841ae9dcc36855
Signed-off-by: Teresa Ho <teresa.ho@windriver.com>
This commit is contained in:
Teresa Ho 2018-11-01 09:57:16 -04:00
parent b26e76dbae
commit 6f34f29939
3 changed files with 256 additions and 0 deletions

View File

@ -0,0 +1,24 @@
From 6cf8ebc9e09035d49cfb051c4c4b03c4b8607ba3 Mon Sep 17 00:00:00 2001
From: Teresa Ho <teresa.ho@windriver.com>
Date: Tue, 30 Oct 2018 11:16:53 -0400
Subject: [PATCH] Remove wrs-binding:mac_filtering and setting extension
---
SPECS/python-openstackclient.spec | 1 +
1 file changed, 1 insertion(+)
diff --git a/SPECS/python-openstackclient.spec b/SPECS/python-openstackclient.spec
index 29fec53..3dd52cb 100644
--- a/SPECS/python-openstackclient.spec
+++ b/SPECS/python-openstackclient.spec
@@ -30,6 +30,7 @@ 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
+Patch0013: 0001-Remove-wrs-binding-mac_filtering-and-setting-extensi.patch
BuildArch: noarch
--
1.8.3.1

View File

@ -14,3 +14,4 @@
1005-meta-US106901-Openstack-CLI-Adoption.patch 1005-meta-US106901-Openstack-CLI-Adoption.patch
1006-meta-patch-for-endpoint-groups.patch 1006-meta-patch-for-endpoint-groups.patch
1007-Allow-setting-wrs-binding-vif_model-using-osclient.patch 1007-Allow-setting-wrs-binding-vif_model-using-osclient.patch
1008-Remove-wrs-binding-mac_filtering-and-setting-extensi.patch

View File

@ -0,0 +1,231 @@
From 2554505ca186f59b4dd51081565c1d6a8be50db7 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Tue, 30 Oct 2018 11:07:43 -0400
Subject: [PATCH] Remove wrs-binding:mac_filtering and setting extension
---
openstackclient/network/v2/port.py | 1 -
openstackclient/network/v2/setting.py | 183 ----------------------------------
setup.cfg | 4 -
3 files changed, 188 deletions(-)
delete mode 100644 openstackclient/network/v2/setting.py
diff --git a/openstackclient/network/v2/port.py b/openstackclient/network/v2/port.py
index 22cba16..d158791 100644
--- a/openstackclient/network/v2/port.py
+++ b/openstackclient/network/v2/port.py
@@ -64,7 +64,6 @@ def _get_columns(item):
'tenant_id': 'project_id',
'mtu': 'wrs-binding:mtu',
'vif_model': 'wrs-binding:vif_model',
- 'mac_filtering': 'wrs-binding:mac_filtering',
}
return sdk_utils.get_osc_show_columns_for_sdk_resource(item, column_map)
diff --git a/openstackclient/network/v2/setting.py b/openstackclient/network/v2/setting.py
deleted file mode 100644
index 6be88dd..0000000
--- a/openstackclient/network/v2/setting.py
+++ /dev/null
@@ -1,183 +0,0 @@
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-#
-# Copyright (c) 2016 Wind River Systems, Inc.
-#
-#
-#
-#
-#
-
-"""Settings action implementations"""
-
-from osc_lib.command import command
-from osc_lib import exceptions
-from osc_lib import utils
-from openstackclient.i18n import _
-from openstackclient.identity import common as identity_common
-from openstackclient.network import common
-from openstackclient.network import sdk_utils
-
-_formatters = {}
-
-
-def _get_columns(item):
- column_map = {"id": "project_id"}
- invisible_columns = ["name"]
- return sdk_utils.get_osc_show_columns_for_sdk_resource(item, column_map,
- invisible_columns)
-
-
-def _get_attrs(client_manager, parsed_args):
- attrs = {key: parsed_args[key] for key in ["mac_filtering"]
- if key in parsed_args}
-
- if 'project' in parsed_args and parsed_args["project"] is not None:
- identity_client = client_manager.identity
- project_id = identity_common.find_project(
- identity_client,
- parsed_args["project"]
- ).id
- attrs['project_id'] = project_id
-
- return attrs
-
-
-class ListSetting(common.NetworkAndComputeLister):
- """List settings of all projects who have non-default setting values"""
-
- def update_parser_common(self, parser):
- return parser
-
- def take_action_network(self, client, parsed_args):
- columns = (
- 'mac_filtering',
- 'project_id'
- )
- column_headers = (
- 'Mac Filtering',
- 'Project ID'
- )
-
- args = {}
-
- data = client.settings(**args)
-
- return (column_headers,
- (utils.get_item_properties(
- s, columns,
- formatters=_formatters,
- ) for s in data))
-
- def take_action_compute(self, client, parsed_args):
- raise exceptions.CommandError("This command needs access to"
- " a network endpoint.")
- return
-
-
-class ShowSetting(common.NetworkAndComputeShowOne):
- """Show settings of a given project"""
-
- def update_parser_common(self, parser):
- parser.add_argument(
- '--project',
- metavar='<project>',
- help=_("Owner's project (name or ID)"),
- required=False
- )
- return parser
-
- def take_action_network(self, client, parsed_args):
- client = self.app.client_manager.network
- # if no project id is specified, operate on current project
- args = _get_attrs(self.app.client_manager, vars(parsed_args))
- if not "project_id" in args:
- args["project_id"] = client.find_tenant().project_id
- project_id = args["project_id"]
-
- obj = client.find_setting(project_id, ignore_missing=False)
-
- display_columns, columns = _get_columns(obj)
- data = utils.get_item_properties(obj, columns, formatters=_formatters)
- return (display_columns, data)
-
- def take_action_compute(self, client, parsed_args):
- raise exceptions.CommandError("This command needs access to"
- " a network endpoint.")
- return
-
-
-# this one uses NetworkAndComputeCommand because settings can be deleted
-# without a project id
-class DeleteSetting(common.NetworkAndComputeCommand):
- """Delete setting"""
-
- def update_parser_common(self, parser):
- parser.add_argument(
- '--project',
- metavar='<project>',
- help=_("Owner's project (name or ID)"),
- required=False
- )
- return parser
-
- def take_action_network(self, client, parsed_args):
- client = self.app.client_manager.network
- # if no project id is specified, operate on current project
- args = _get_attrs(self.app.client_manager, vars(parsed_args))
- if not "project_id" in args:
- args["project_id"] = client.find_tenant().project_id
- project_id = args["project_id"]
-
- client.delete_setting(project_id)
- return
-
- def take_action_compute(self, client, parsed_args):
- raise exceptions.CommandError("This command needs "
- "access to a network endpoint.")
- return
-
-
-class UpdateSetting(command.Command):
- """Set setting properties"""
-
- def get_parser(self, prog_name):
- parser = super(UpdateSetting, self).get_parser(prog_name)
- parser.add_argument(
- '--project',
- metavar='<project>',
- help=_("Owner's project (name or ID)"),
- required=False
- )
- parser.add_argument('--mac-filtering', metavar='mac_filtering',
- help="Enable/Disable source MAC filtering"
- " on all ports",
- required=True)
- return parser
-
- def take_action(self, parsed_args):
- client = self.app.client_manager.network
- # if no project id is specified, operate on current project
- args = _get_attrs(self.app.client_manager, vars(parsed_args))
- if not "project_id" in args:
- args["project_id"] = client.find_tenant().project_id
- project_id = args["project_id"]
- del args['project_id']
-
- client.find_setting(project_id, ignore_missing=False)
-
- if args == {}:
- msg = "Nothing specified to be set"
- raise exceptions.CommandError(msg)
-
- client.update_setting(project_id, **args)
- return
diff --git a/setup.cfg b/setup.cfg
index d87b387..3e107bb 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -435,10 +435,6 @@ openstack.network.v2 =
portforwarding_create = openstackclient.network.v2.portforwarding:CreatePortforwarding
portforwarding_update = openstackclient.network.v2.portforwarding:UpdatePortforwarding
portforwarding_delete = openstackclient.network.v2.portforwarding:DeletePortforwarding
- setting_list = openstackclient.network.v2.setting:ListSetting
- setting_show = openstackclient.network.v2.setting:ShowSetting
- setting_update = openstackclient.network.v2.setting:UpdateSetting
- setting_delete = openstackclient.network.v2.setting:DeleteSetting
net_host_list = openstackclient.network.v2.host:ListHost
net_host_show = openstackclient.network.v2.host:ShowHost
net_host_create = openstackclient.network.v2.host:CreateHost
--
1.8.3.1