Skip to content

Commit 317ee5d

Browse files
author
Matthew Fisher
committed
feat(client): add --username flag to auth:passwd
1 parent 79028db commit 317ee5d

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

client/deis.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -895,9 +895,11 @@ def auth_passwd(self, args):
895895
896896
Options:
897897
--password=<password>
898-
provide the current password for the account.
898+
the current password for the account.
899899
--new-password=<new-password>
900-
provide a new password for the account.
900+
the new password for the account.
901+
--username=<username>
902+
the account's username.
901903
"""
902904
if not self._settings.get('token'):
903905
raise EnvironmentError(
@@ -912,7 +914,11 @@ def auth_passwd(self, args):
912914
if new_password != confirm:
913915
self._logger.error('Password mismatch, not changing.')
914916
sys.exit(1)
915-
payload = {'password': password, 'new_password': new_password}
917+
payload = {
918+
'password': password,
919+
'new_password': new_password,
920+
'username': args.get('--username', self._settings['username']),
921+
}
916922
response = self._dispatch('post', "/v1/auth/passwd", json.dumps(payload))
917923
if response.status_code == requests.codes.ok:
918924
self._logger.info('Password change succeeded.')

0 commit comments

Comments
 (0)