Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker_login: Hide password from response #34491

Merged
merged 1 commit into from
Feb 16, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/ansible/modules/cloud/docker/docker_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@
type: dict
sample: {
"email": "testuer@yahoo.com",
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"serveraddress": "localhost:5000",
"username": "testuser"
}
Expand Down Expand Up @@ -190,6 +189,11 @@ def login(self):
)
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:
Expand Down