mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 01:17:37 -02:30
Fix pathing issue for credential file references
This commit is contained in:
committed by
Shane McDonald
parent
73418e41f3
commit
64f45da4d2
@@ -528,15 +528,20 @@ class CredentialType(CommonModelNameNotUnique):
|
|||||||
with open(path, 'w') as f:
|
with open(path, 'w') as f:
|
||||||
f.write(data)
|
f.write(data)
|
||||||
os.chmod(path, stat.S_IRUSR | stat.S_IWUSR)
|
os.chmod(path, stat.S_IRUSR | stat.S_IWUSR)
|
||||||
|
# FIXME: develop some better means of referencing paths inside containers
|
||||||
|
container_path = os.path.join(
|
||||||
|
'/runner',
|
||||||
|
os.path.basename(path)
|
||||||
|
)
|
||||||
|
|
||||||
# determine if filename indicates single file or many
|
# determine if filename indicates single file or many
|
||||||
if file_label.find('.') == -1:
|
if file_label.find('.') == -1:
|
||||||
tower_namespace.filename = path
|
tower_namespace.filename = container_path
|
||||||
else:
|
else:
|
||||||
if not hasattr(tower_namespace, 'filename'):
|
if not hasattr(tower_namespace, 'filename'):
|
||||||
tower_namespace.filename = TowerNamespace()
|
tower_namespace.filename = TowerNamespace()
|
||||||
file_label = file_label.split('.')[1]
|
file_label = file_label.split('.')[1]
|
||||||
setattr(tower_namespace.filename, file_label, path)
|
setattr(tower_namespace.filename, file_label, container_path)
|
||||||
|
|
||||||
injector_field = self._meta.get_field('injectors')
|
injector_field = self._meta.get_field('injectors')
|
||||||
for env_var, tmpl in self.injectors.get('env', {}).items():
|
for env_var, tmpl in self.injectors.get('env', {}).items():
|
||||||
|
|||||||
Reference in New Issue
Block a user