Merge pull request #4184 from rooftopcellist/delete_tarball

Delete collection tarball when no longer needed

Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
softwarefactory-project-zuul[bot]
2019-07-01 15:44:49 +00:00
committed by GitHub

View File

@@ -119,6 +119,7 @@ def ship(path):
""" """
Ship gathered metrics via the Insights agent Ship gathered metrics via the Insights agent
""" """
try:
agent = 'insights-client' agent = 'insights-client'
if shutil.which(agent) is None: if shutil.which(agent) is None:
logger.error('could not find {} on PATH'.format(agent)) logger.error('could not find {} on PATH'.format(agent))
@@ -140,3 +141,6 @@ def ship(path):
logger.exception('{} failure:'.format(cmd)) logger.exception('{} failure:'.format(cmd))
except subprocess.TimeoutExpired: except subprocess.TimeoutExpired:
logger.exception('{} timeout:'.format(cmd)) logger.exception('{} timeout:'.format(cmd))
finally:
# cleanup tar.gz
os.remove(path)