diff options
| author | Jenkins <jenkins@review.openstack.org> | 2014-02-22 06:00:18 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2014-02-22 06:00:18 +0000 |
| commit | 034a9d158f27bb9bd1a7430c09d1826196215093 (patch) | |
| tree | fc88f06a264bcc19847bedda75213846a4f65a75 /openstackclient/identity/v2_0 | |
| parent | 8b494f08b2d60b487b37de6603349db66496b955 (diff) | |
| parent | 033f27fe4dc4455c2f07978a273fd65faa653b67 (diff) | |
| download | python-openstackclient-034a9d158f27bb9bd1a7430c09d1826196215093.tar.gz | |
Merge "Add ability to prompt for passwords for user create and set"
Diffstat (limited to 'openstackclient/identity/v2_0')
| -rw-r--r-- | openstackclient/identity/v2_0/user.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/openstackclient/identity/v2_0/user.py b/openstackclient/identity/v2_0/user.py index 371c45a9..abcafdd0 100644 --- a/openstackclient/identity/v2_0/user.py +++ b/openstackclient/identity/v2_0/user.py @@ -43,6 +43,12 @@ class CreateUser(show.ShowOne): help='New user password', ) parser.add_argument( + '--password-prompt', + dest="password_prompt", + action="store_true", + help='Prompt interactively for password', + ) + parser.add_argument( '--email', metavar='<user-email>', help='New user email address', @@ -80,6 +86,8 @@ class CreateUser(show.ShowOne): enabled = True if parsed_args.disable: enabled = False + if parsed_args.password_prompt: + parsed_args.password = utils.get_password(self.app.stdin) user = identity_client.users.create( parsed_args.name, @@ -225,6 +233,12 @@ class SetUser(command.Command): help='New user password', ) parser.add_argument( + '--password-prompt', + dest="password_prompt", + action="store_true", + help='Prompt interactively for password', + ) + parser.add_argument( '--email', metavar='<user-email>', help='New user email address', @@ -251,6 +265,9 @@ class SetUser(command.Command): self.log.debug('take_action(%s)' % parsed_args) identity_client = self.app.client_manager.identity + if parsed_args.password_prompt: + parsed_args.password = utils.get_password(self.app.stdin) + if (not parsed_args.name and not parsed_args.name and not parsed_args.password |
