Fix deployment when umask is non-standard. Fixes #29005

This commit is contained in:
Frederic Crozat 2015-11-18 15:20:41 +01:00
parent fb3c8be32b
commit 2a2c69d77c

View File

@ -217,6 +217,7 @@ def main(argv): # pylint: disable=W0613
if not OPTIONS.tty:
sys.stderr.write(OPTIONS.delimiter + '\n')
sys.stderr.flush()
old_umask = os.umask(0o077)
if OPTIONS.tty:
stdout, _ = subprocess.Popen(salt_argv, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
sys.stdout.write(stdout)
@ -228,6 +229,7 @@ def main(argv): # pylint: disable=W0613
shutil.rmtree(OPTIONS.saltdir)
else:
os.execv(sys.executable, salt_argv)
os.umask(old_umask)
if __name__ == '__main__':
sys.exit(main(sys.argv))