fix redaction

This commit is contained in:
Erik Johnson 2015-08-28 16:12:12 -05:00
parent 399871e6dd
commit 07db5a7038
2 changed files with 6 additions and 3 deletions

View file

@ -817,7 +817,7 @@ def remote_set(cwd, name='origin', url=None, user=None, https_user=None,
https_only=True)
except ValueError as exc:
raise SaltInvocationError(exc.__str__())
cmd = 'git remote add {0} {1}'.format(name, url)
cmd = 'git remote add {0} \'{1}\''.format(name, url)
_git_run(cmd, cwd=cwd, runas=user)
return remote_get(cwd=cwd, remote=name, user=None)

View file

@ -264,12 +264,15 @@ def latest(name,
if remote is None or remote[0] != desired_fetch_url:
__salt__['git.remote_set'](target,
name=remote_name,
url=desired_fetch_url,
url=name,
user=user,
https_user=https_user,
https_pass=https_pass)
ret['changes']['remote/{0}'.format(remote_name)] = (
"{0} => {1}".format(str(remote), redacted_fetch_url)
"{0} => {1}".format(
salt.utils.url.redact_http_basic_auth(str(remote)),
redacted_fetch_url
)
)
# Set to fetch later since we just added the remote and
# need to get the refs