mirror of
https://github.com/ansible/awx.git
synced 2026-03-20 02:17:37 -02:30
fix a bug which can cause isolated artifact cleanup to fail
see: https://github.com/ansible/awx/issues/4376
This commit is contained in:
@@ -51,9 +51,11 @@ def main():
|
|||||||
try:
|
try:
|
||||||
re_match = re.match(r'\/tmp\/awx_\d+_.+', path)
|
re_match = re.match(r'\/tmp\/awx_\d+_.+', path)
|
||||||
if re_match is not None:
|
if re_match is not None:
|
||||||
if subprocess.check_call(['ansible-runner', 'is-alive', path]) == 0:
|
try:
|
||||||
continue
|
if subprocess.check_call(['ansible-runner', 'is-alive', path]) == 0:
|
||||||
else:
|
continue
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
# the job isn't running anymore, clean up this path
|
||||||
module.debug('Deleting path {} its job has completed.'.format(path))
|
module.debug('Deleting path {} its job has completed.'.format(path))
|
||||||
except (ValueError, IndexError):
|
except (ValueError, IndexError):
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user