diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-10-25 10:19:30 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-10-25 10:19:30 +0000 |
| commit | b6a88229219bc6fe45426c4b235bc3d7062a1678 (patch) | |
| tree | 4ee7059e33616e14351b3d6204e32a9eb1bbd89d | |
| parent | 2be2190115f41509a5443842961b14b0a0923a34 (diff) | |
| parent | 3770ad08b21b5ad7dd5430e810f1618435b269d5 (diff) | |
| download | python-openstackclient-b6a88229219bc6fe45426c4b235bc3d7062a1678.tar.gz | |
Merge "Warning for empty password set for user create/set"
| -rw-r--r-- | openstackclient/identity/v2_0/user.py | 8 | ||||
| -rw-r--r-- | openstackclient/identity/v3/user.py | 12 | ||||
| -rw-r--r-- | releasenotes/notes/bug-1607959-a52aa93e3793f28a.yaml | 6 |
3 files changed, 26 insertions, 0 deletions
diff --git a/openstackclient/identity/v2_0/user.py b/openstackclient/identity/v2_0/user.py index d2075150..bc091ce7 100644 --- a/openstackclient/identity/v2_0/user.py +++ b/openstackclient/identity/v2_0/user.py @@ -94,6 +94,10 @@ class CreateUser(command.ShowOne): if parsed_args.password_prompt: parsed_args.password = utils.get_password(self.app.stdin) + if not parsed_args.password: + LOG.warning(_("No password was supplied, authentication will fail " + "when a user does not have a password.")) + try: user = identity_client.users.create( parsed_args.name, @@ -292,6 +296,10 @@ class SetUser(command.Command): if parsed_args.password_prompt: parsed_args.password = utils.get_password(self.app.stdin) + if '' == parsed_args.password: + LOG.warning(_("No password was supplied, authentication will fail " + "when a user does not have a password.")) + user = utils.find_resource( identity_client.users, parsed_args.user, diff --git a/openstackclient/identity/v3/user.py b/openstackclient/identity/v3/user.py index dc47ef8d..1e086fb6 100644 --- a/openstackclient/identity/v3/user.py +++ b/openstackclient/identity/v3/user.py @@ -110,6 +110,10 @@ class CreateUser(command.ShowOne): if parsed_args.password_prompt: parsed_args.password = utils.get_password(self.app.stdin) + if not parsed_args.password: + LOG.warning(_("No password was supplied, authentication will fail " + "when a user does not have a password.")) + try: user = identity_client.users.create( name=parsed_args.name, @@ -329,6 +333,10 @@ class SetUser(command.Command): if parsed_args.password_prompt: parsed_args.password = utils.get_password(self.app.stdin) + if '' == parsed_args.password: + LOG.warning(_("No password was supplied, authentication will fail " + "when a user does not have a password.")) + user = utils.find_resource( identity_client.users, parsed_args.user, @@ -408,6 +416,10 @@ class SetPasswordUser(command.Command): password = utils.get_password( self.app.stdin, prompt="New Password:") + if '' == password: + LOG.warning(_("No password was supplied, authentication will fail " + "when a user does not have a password.")) + identity_client.users.update_password(current_password, password) diff --git a/releasenotes/notes/bug-1607959-a52aa93e3793f28a.yaml b/releasenotes/notes/bug-1607959-a52aa93e3793f28a.yaml new file mode 100644 index 00000000..172b1301 --- /dev/null +++ b/releasenotes/notes/bug-1607959-a52aa93e3793f28a.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + A warning message will be shown when an empty password is used + for ``user create`` and ``user set`` operations. + [Bug `1607959 <https://bugs.launchpad.net/bugs/1607959>`_]
\ No newline at end of file |
