1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 15:21:13 +03:00

Merge pull request #4377 from ryanpetrello/fix-4376

fix a bug which can cause isolated artifact cleanup to fail

Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
softwarefactory-project-zuul[bot] 2019-07-25 20:27:03 +00:00 committed by GitHub
commit a5c5874e20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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