summaryrefslogtreecommitdiff
path: root/openstackclient/identity
diff options
context:
space:
mode:
authorM V P Nitesh <m.nitesh@nectechnologies.in>2017-07-17 18:08:58 +0530
committerdeepak_mourya <deepakmoriya7@gmail.com>2018-09-18 08:56:11 +0530
commiteb001733fd3c1a98027f7439b84e952f1eb2a406 (patch)
tree68ff735a1cb0b49f00da66d3f2b4e08c9283ee82 /openstackclient/identity
parent1b66ad9067cc404ebfdc8569822d226d5bffddd6 (diff)
downloadpython-openstackclient-eb001733fd3c1a98027f7439b84e952f1eb2a406.tar.gz
Now we can add description for role creation in OSC
Now user can add the description when user create's the role using OSC ``openstack role create`` command. User can add the description by adding `--description <Description>` to OSC ``openstack role create`` command. Co-Authored-By: Deepak Mourya<deepakmoriya7@gmail.com> Change-Id: I858e004c3b29c687b6a39c8a1ed5fb029eb19c67 Depends-on: I230af9cc833af13064636b5d9a7ce6334c3f6e9a Closes-Bug: #1669080
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 58a76f8a..09e914b5 100644
--- a/openstackclient/identity/v3/role.py
+++ b/openstackclient/identity/v3/role.py
@@ -178,6 +178,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)'),
@@ -199,7 +204,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:
@@ -450,6 +456,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)'),
@@ -473,7 +484,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):