mirror of
https://github.com/ansible/awx.git
synced 2026-02-27 07:56:06 -03:30
Merge pull request #6301 from gamuniz/catch_analytics_failure
rework the gather() to always delete the leftover directories Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
@@ -134,13 +134,17 @@ def gather(dest=None, module=None, collection_type='scheduled'):
|
|||||||
settings.SYSTEM_UUID,
|
settings.SYSTEM_UUID,
|
||||||
run_now.strftime('%Y-%m-%d-%H%M%S%z')
|
run_now.strftime('%Y-%m-%d-%H%M%S%z')
|
||||||
])
|
])
|
||||||
tgz = shutil.make_archive(
|
try:
|
||||||
os.path.join(os.path.dirname(dest), tarname),
|
tgz = shutil.make_archive(
|
||||||
'gztar',
|
os.path.join(os.path.dirname(dest), tarname),
|
||||||
dest
|
'gztar',
|
||||||
)
|
dest
|
||||||
shutil.rmtree(dest)
|
)
|
||||||
return tgz
|
return tgz
|
||||||
|
except Exception:
|
||||||
|
logger.exception("Failed to write analytics archive file")
|
||||||
|
finally:
|
||||||
|
shutil.rmtree(dest)
|
||||||
|
|
||||||
|
|
||||||
def ship(path):
|
def ship(path):
|
||||||
|
|||||||
Reference in New Issue
Block a user