From eb001733fd3c1a98027f7439b84e952f1eb2a406 Mon Sep 17 00:00:00 2001 From: M V P Nitesh Date: Mon, 17 Jul 2017 18:08:58 +0530 Subject: 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 ` to OSC ``openstack role create`` command. Co-Authored-By: Deepak Mourya Change-Id: I858e004c3b29c687b6a39c8a1ed5fb029eb19c67 Depends-on: I230af9cc833af13064636b5d9a7ce6334c3f6e9a Closes-Bug: #1669080 --- openstackclient/identity/v3/role.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'openstackclient/identity') 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 @@ -177,6 +177,11 @@ class CreateRole(command.ShowOne): metavar='', help=_('New role name'), ) + parser.add_argument( + '--description', + metavar='', + help=_('Add description about the role'), + ) parser.add_argument( '--domain', metavar='', @@ -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: @@ -449,6 +455,11 @@ class SetRole(command.Command): metavar='', help=_('Role to modify (name or ID)'), ) + parser.add_argument( + '--description', + metavar='', + help=_('Add description about the role'), + ) parser.add_argument( '--domain', metavar='', @@ -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): -- cgit v1.2.1