mirror of
https://github.com/ansible/awx.git
synced 2026-05-09 10:27:37 -02:30
Insert signed public key in artifact_dir, hacky fix for issue #4139
Signed-off-by: Jaap de Koning <jaap.de.koning@bigdatarepublic.nl>
This commit is contained in:
@@ -828,8 +828,10 @@ class BaseTask(object):
|
|||||||
os.chmod(path, stat.S_IRUSR | stat.S_IWUSR)
|
os.chmod(path, stat.S_IRUSR | stat.S_IWUSR)
|
||||||
private_data_files['credentials'][credential] = path
|
private_data_files['credentials'][credential] = path
|
||||||
for credential, data in private_data.get('certificates', {}).items():
|
for credential, data in private_data.get('certificates', {}).items():
|
||||||
name = 'credential_%d-cert.pub' % credential.pk
|
artifact_dir = os.path.join(private_data_dir, 'artifacts', str(self.instance.id))
|
||||||
path = os.path.join(private_data_dir, name)
|
if not os.path.exists(artifact_dir):
|
||||||
|
os.makedirs(artifact_dir, mode=0o700)
|
||||||
|
path = os.path.join(artifact_dir, 'ssh_key_data-cert.pub')
|
||||||
with open(path, 'w') as f:
|
with open(path, 'w') as f:
|
||||||
f.write(data)
|
f.write(data)
|
||||||
f.close()
|
f.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user