fix a bug in inventory generation for isolated nodes

see: https://github.com/ansible/ansible-tower/issues/7849
related: https://github.com/ansible/awx/pull/551
This commit is contained in:
Ryan Petrello
2018-01-10 19:10:57 -05:00
parent 4c40791d06
commit b8758044e0

View File

@@ -707,7 +707,7 @@ class BaseTask(LogErrorsTask):
'hostvars': True,
}).run(buff)
json_data = buff.getvalue().strip()
f.write("#! /usr/bin/env python\nprint '''%s'''\n" % json_data)
f.write('#! /usr/bin/env python\n# -*- coding: utf-8 -*-\nprint %r\n' % json_data)
os.chmod(path, stat.S_IRUSR | stat.S_IXUSR)
return path
else: