From d66cad3e0eea37d1549aa57cd817a8da3e96ff3a Mon Sep 17 00:00:00 2001 From: cclauss Date: Wed, 21 Feb 2018 12:18:52 +0100 Subject: [PATCH] Py3 Syntax Errors: 0700 -> 0x700 and 0600 -> 0x600 $ __python3 -c "0700"__ ``` File "", line 1 0700 ^ SyntaxError: invalid token ``` --- awx/main/models/jobs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/main/models/jobs.py b/awx/main/models/jobs.py index 83eb228216..16a8fd83ae 100644 --- a/awx/main/models/jobs.py +++ b/awx/main/models/jobs.py @@ -746,7 +746,7 @@ class Job(UnifiedJob, JobOptions, SurveyJobMixin, JobNotificationMixin, TaskMana def start_job_fact_cache(self, destination, modification_times, timeout=None): destination = os.path.join(destination, 'facts') - os.makedirs(destination, mode=0700) + os.makedirs(destination, mode=0x700) hosts = self._get_inventory_hosts() if timeout is None: timeout = settings.ANSIBLE_FACT_CACHE_TIMEOUT @@ -760,7 +760,7 @@ class Job(UnifiedJob, JobOptions, SurveyJobMixin, JobNotificationMixin, TaskMana system_tracking_logger.error('facts for host {} could not be cached'.format(smart_str(host.name))) continue with codecs.open(filepath, 'w', encoding='utf-8') as f: - os.chmod(f.name, 0600) + os.chmod(f.name, 0x600) json.dump(host.ansible_facts, f) # make note of the time we wrote the file so we can check if it changed later modification_times[filepath] = os.path.getmtime(filepath)