From 0741d34bfe2da28877157e199ed4feb3f1cb47bc Mon Sep 17 00:00:00 2001 From: wengjiangang Date: Tue, 28 Jun 2016 03:49:34 -0400 Subject: [PATCH] Fix problem of RBAC command arguments Add default value '*' to argument 'target_tenant' Change-Id: I61c35ee4def53bc141a9ce562c01fe7422663a0e Closes-Bug: #1596750 --- neutronclient/neutron/v2_0/rbac.py | 1 + neutronclient/tests/unit/test_cli20_rbac.py | 2 +- .../notes/fix-rbac-create-command-dd40a474f0f092db.yaml | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/fix-rbac-create-command-dd40a474f0f092db.yaml diff --git a/neutronclient/neutron/v2_0/rbac.py b/neutronclient/neutron/v2_0/rbac.py index 46f254af8..64645e573 100644 --- a/neutronclient/neutron/v2_0/rbac.py +++ b/neutronclient/neutron/v2_0/rbac.py @@ -69,6 +69,7 @@ class CreateRBACPolicy(neutronV20.CreateCommand): help=_('Type of the object that RBAC policy affects.')) parser.add_argument( '--target-tenant', + default='*', help=_('ID of the tenant to which the RBAC ' 'policy will be enforced.')) parser.add_argument( diff --git a/neutronclient/tests/unit/test_cli20_rbac.py b/neutronclient/tests/unit/test_cli20_rbac.py index ca7ea46d2..ca89df6f9 100644 --- a/neutronclient/tests/unit/test_cli20_rbac.py +++ b/neutronclient/tests/unit/test_cli20_rbac.py @@ -44,7 +44,7 @@ class CLITestV20RBACBaseJSON(test_cli20.CLITestV20Base): '--action', 'access_as_shared'] position_names = ['object_id', 'object_type', 'target_tenant', 'action'] - position_values = [name, self.object_type_val, None, + position_values = [name, self.object_type_val, '*', 'access_as_shared'] self._test_create_resource(resource, cmd, name, myid, args, position_names, position_values) diff --git a/releasenotes/notes/fix-rbac-create-command-dd40a474f0f092db.yaml b/releasenotes/notes/fix-rbac-create-command-dd40a474f0f092db.yaml new file mode 100644 index 000000000..7ae438abf --- /dev/null +++ b/releasenotes/notes/fix-rbac-create-command-dd40a474f0f092db.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - Fix 'bug 1596750 ' + that using 'rbac-create' without specifying 'target-tenant' will + return 'Request Failed internal server error while processing your + request'. + Update the default value of the argument '--target-tenant' to '*'