Skip to content

Commit af7a747

Browse files
AlanCodingshanemcd
authored andcommitted
Fix project folder deletion
Fix another absolute path reference in containers
1 parent b79f1d3 commit af7a747

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

awx/main/tasks.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,8 @@ def build_params_resource_profiling(self, instance, private_data_dir):
10321032
results_dir = os.path.join(private_data_dir, 'artifacts/playbook_profiling')
10331033
if not os.path.isdir(results_dir):
10341034
os.makedirs(results_dir, stat.S_IREAD | stat.S_IWRITE | stat.S_IEXEC)
1035+
# FIXME: develop some better means of referencing paths inside containers
1036+
container_results_dir = os.path.join('/runner', 'artifacts/playbook_profiling')
10351037

10361038
logger.debug('Collected the following resource profiling intervals: cpu: {} mem: {} pid: {}'
10371039
.format(cpu_poll_interval, mem_poll_interval, pid_poll_interval))
@@ -1041,7 +1043,7 @@ def build_params_resource_profiling(self, instance, private_data_dir):
10411043
'resource_profiling_cpu_poll_interval': cpu_poll_interval,
10421044
'resource_profiling_memory_poll_interval': mem_poll_interval,
10431045
'resource_profiling_pid_poll_interval': pid_poll_interval,
1044-
'resource_profiling_results_dir': results_dir})
1046+
'resource_profiling_results_dir': container_results_dir})
10451047

10461048
return resource_profiling_params
10471049

awx/playbooks/project_update.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
tasks:
2525

2626
- name: delete project directory before update
27-
file:
28-
path: "{{project_path|quote}}"
29-
state: absent
27+
command: "rm -rf {{project_path}}/*" # volume mounted, cannot delete folder itself
3028
tags:
3129
- delete
3230

0 commit comments

Comments
 (0)