Inventory directory already pre-created

This commit is contained in:
Alan Rominger 2021-04-20 10:18:23 -04:00
parent 3c785fbff3
commit 0e17023ba3
No known key found for this signature in database
GPG Key ID: C2D7EAAA12B63559

View File

@ -1035,7 +1035,6 @@ class BaseTask(object):
self.host_map = {hostname: hv.pop('remote_tower_id', '') for hostname, hv in script_data.get('_meta', {}).get('hostvars', {}).items()}
json_data = json.dumps(script_data)
path = os.path.join(private_data_dir, 'inventory')
os.makedirs(path, mode=0o700)
fn = os.path.join(path, 'hosts')
with open(fn, 'w') as f:
os.chmod(fn, stat.S_IRUSR | stat.S_IXUSR | stat.S_IWUSR)