mirror of
https://github.com/ansible/awx.git
synced 2026-05-23 08:37:48 -02:30
Delete collection tarball when no longer needed
* Delete after shipping it * Delete when ship() fails
This commit is contained in:
@@ -119,6 +119,7 @@ def ship(path):
|
||||
"""
|
||||
Ship gathered metrics via the Insights agent
|
||||
"""
|
||||
try:
|
||||
agent = 'insights-client'
|
||||
if shutil.which(agent) is None:
|
||||
logger.error('could not find {} on PATH'.format(agent))
|
||||
@@ -140,3 +141,6 @@ def ship(path):
|
||||
logger.exception('{} failure:'.format(cmd))
|
||||
except subprocess.TimeoutExpired:
|
||||
logger.exception('{} timeout:'.format(cmd))
|
||||
finally:
|
||||
# cleanup tar.gz
|
||||
os.remove(path)
|
||||
|
||||
Reference in New Issue
Block a user