diff options
author | Abhijeet Kasurde <akasurde@redhat.com> | 2018-02-16 10:41:54 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-16 10:41:54 +0530 |
commit | 4cc7af7372fa21a5c338089c9a39b1a139dce3c5 (patch) | |
tree | 7560860460f39a43f3e043c9cb3919249f09ff37 | |
parent | a377302d6b26b5a112c7db2bf9e9fb1a8a676319 (diff) | |
download | ansible-4cc7af7372fa21a5c338089c9a39b1a139dce3c5.tar.gz |
docker_login: Hide password from response (#34491)
Fixes: #32869
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
-rw-r--r-- | lib/ansible/modules/cloud/docker/docker_login.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/ansible/modules/cloud/docker/docker_login.py b/lib/ansible/modules/cloud/docker/docker_login.py index 06f155e882..92ae00df7f 100644 --- a/lib/ansible/modules/cloud/docker/docker_login.py +++ b/lib/ansible/modules/cloud/docker/docker_login.py @@ -124,7 +124,6 @@ login_results: type: dict sample: { "email": "testuer@yahoo.com", - "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "serveraddress": "localhost:5000", "username": "testuser" } @@ -190,6 +189,11 @@ class LoginManager(DockerBaseClass): ) except Exception as exc: self.fail("Logging into %s for user %s failed - %s" % (self.registry_url, self.username, str(exc))) + + # If user is already logged in, then response contains password for user + # This returns correct password if user is logged in and wrong password is given. + if 'password' in response: + del response['password'] self.results['login_result'] = response if not self.check_mode: |