summaryrefslogtreecommitdiff
path: root/openstackclient/identity
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-03-20 18:59:44 +0000
committerGerrit Code Review <review@openstack.org>2020-03-20 18:59:44 +0000
commitfc12033f1da53fe11f930dd405eae5e2bf814621 (patch)
tree7f6ea1c7667fe012fb316fef5a4a83acd12c4610 /openstackclient/identity
parent9277fd471a71ecac330b78718b7eecd38ce180c8 (diff)
parenteb001733fd3c1a98027f7439b84e952f1eb2a406 (diff)
downloadpython-openstackclient-fc12033f1da53fe11f930dd405eae5e2bf814621.tar.gz
Merge "Now we can add description for role creation in OSC"
Diffstat (limited to 'openstackclient/identity')
-rw-r--r--openstackclient/identity/v3/role.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/openstackclient/identity/v3/role.py b/openstackclient/identity/v3/role.py
index 986f823f..36f3f938 100644
--- a/openstackclient/identity/v3/role.py
+++ b/openstackclient/identity/v3/role.py
@@ -177,6 +177,11 @@ class CreateRole(command.ShowOne):
help=_('New role name'),
)
parser.add_argument(
+ '--description',
+ metavar='<description>',
+ help=_('Add description about the role'),
+ )
+ parser.add_argument(
'--domain',
metavar='<domain>',
help=_('Domain the role belongs to (name or ID)'),
@@ -198,7 +203,8 @@ class CreateRole(command.ShowOne):
try:
role = identity_client.roles.create(
- name=parsed_args.name, domain=domain_id)
+ name=parsed_args.name, domain=domain_id,
+ description=parsed_args.description)
except ks_exc.Conflict:
if parsed_args.or_show:
@@ -346,6 +352,11 @@ class SetRole(command.Command):
help=_('Role to modify (name or ID)'),
)
parser.add_argument(
+ '--description',
+ metavar='<description>',
+ help=_('Add description about the role'),
+ )
+ parser.add_argument(
'--domain',
metavar='<domain>',
help=_('Domain the role belongs to (name or ID)'),
@@ -369,7 +380,8 @@ class SetRole(command.Command):
parsed_args.role,
domain_id=domain_id)
- identity_client.roles.update(role.id, name=parsed_args.name)
+ identity_client.roles.update(role.id, name=parsed_args.name,
+ description=parsed_args.description)
class ShowRole(command.ShowOne):