From b8758044e0a89d6543cc1fe46e4b11be48e51a10 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Wed, 10 Jan 2018 19:10:57 -0500 Subject: [PATCH] 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 --- awx/main/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 822e5b89f9..e2528d197d 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -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: