Merge pull request #47025 from terminalmage/fix-server_id-windows

Fix server_id grain in PY3 on Windows
This commit is contained in:
Nicole Thomas 2018-04-12 11:07:59 -04:00 committed by GitHub
commit 9e37cfc9d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2411,9 +2411,8 @@ def get_server_id():
if py_ver >= (3, 3):
# Python 3.3 enabled hash randomization, so we need to shell out to get
# a reliable hash.
py_bin = 'python{0}.{1}'.format(*py_ver)
id_hash = __salt__['cmd.run'](
[py_bin, '-c', 'print(hash("{0}"))'.format(id_)],
[sys.executable, '-c', 'print(hash("{0}"))'.format(id_)],
env={'PYTHONHASHSEED': '0'}
)
try: