diff options
| author | Slawek Kaplonski <skaplons@redhat.com> | 2020-12-22 15:31:44 +0100 |
|---|---|---|
| committer | Slawek Kaplonski <skaplons@redhat.com> | 2021-05-26 09:29:15 +0200 |
| commit | b26b7f3440d4f756c0b7906b93751d7e83a733f7 (patch) | |
| tree | e318e4700f87222b87a4e677e2f7f4dbcf518fae /openstackclient/network/v2/network_rbac.py | |
| parent | 6bdf030953d449693c97bff8812b7ced981a2015 (diff) | |
| download | python-openstackclient-b26b7f3440d4f756c0b7906b93751d7e83a733f7.tar.gz | |
Allow to send extra attributes in Neutron related commands
To deprecate and drop support for neutronclient CLI and use only
OSC we need feature parity between OSC and neutronclient.
Last missing piece here is possibility to send in POST/PUT requests
unknown parameters to the Neutron server.
This patch adds such possibility to the OSC.
Change-Id: Iba09297c2be9fb9fa0be1b3dc65755277b79230e
Diffstat (limited to 'openstackclient/network/v2/network_rbac.py')
| -rw-r--r-- | openstackclient/network/v2/network_rbac.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/openstackclient/network/v2/network_rbac.py b/openstackclient/network/v2/network_rbac.py index 4984e89d..692a4385 100644 --- a/openstackclient/network/v2/network_rbac.py +++ b/openstackclient/network/v2/network_rbac.py @@ -21,6 +21,7 @@ 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 @@ -90,7 +91,7 @@ def _get_attrs(client_manager, parsed_args): # TODO(abhiraut): Use the SDK resource mapped attribute names once the # OSC minimum requirements include SDK 1.0. -class CreateNetworkRBAC(command.ShowOne): +class CreateNetworkRBAC(command.ShowOne, common.NeutronCommandWithExtraArgs): _description = _("Create network RBAC policy") def get_parser(self, prog_name): @@ -150,6 +151,8 @@ class CreateNetworkRBAC(command.ShowOne): def take_action(self, parsed_args): client = self.app.client_manager.network attrs = _get_attrs(self.app.client_manager, parsed_args) + attrs.update( + self._parse_extra_properties(parsed_args.extra_properties)) obj = client.create_rbac_policy(**attrs) display_columns, columns = _get_columns(obj) data = utils.get_item_properties(obj, columns) @@ -253,7 +256,7 @@ class ListNetworkRBAC(command.Lister): # TODO(abhiraut): Use the SDK resource mapped attribute names once the # OSC minimum requirements include SDK 1.0. -class SetNetworkRBAC(command.Command): +class SetNetworkRBAC(common.NeutronCommandWithExtraArgs): _description = _("Set network RBAC policy properties") def get_parser(self, prog_name): @@ -291,6 +294,8 @@ class SetNetworkRBAC(command.Command): parsed_args.target_project_domain, ).id attrs['target_tenant'] = project_id + attrs.update( + self._parse_extra_properties(parsed_args.extra_properties)) client.update_rbac_policy(obj, **attrs) |
