Merge pull request #38667 from rallytime/bp-37982

Back-port #37982 to 2016.11
This commit is contained in:
Mike Place 2017-01-17 08:42:12 -07:00 committed by GitHub
commit 89dc86e2bc

View file

@ -1165,7 +1165,7 @@ def hash_known_hosts(user=None, config=None):
origmode = os.stat(full).st_mode
cmd = ['ssh-keygen', '-H', '-f', full]
cmd_result = __salt__['cmd.run'](cmd, python_shell=False)
os.stat(full, origmode)
os.chmod(full, origmode)
# ssh-keygen creates a new file, thus a chown is required.
if os.geteuid() == 0 and user:
uinfo = __salt__['user.info'](user)