mirror of
https://github.com/ansible/awx.git
synced 2026-03-11 14:39:30 -02:30
Fail more gracefully if analytics.ship() is called with a bad path,
or it's deleted out from under us.
This commit is contained in:
@@ -191,6 +191,9 @@ def ship(path):
|
||||
if not path:
|
||||
logger.error('Automation Analytics TAR not found')
|
||||
return
|
||||
if not os.path.exists(path):
|
||||
logger.error('Automation Analytics TAR {} not found'.format(path))
|
||||
return
|
||||
if "Error:" in str(path):
|
||||
return
|
||||
try:
|
||||
@@ -223,4 +226,5 @@ def ship(path):
|
||||
response.text))
|
||||
finally:
|
||||
# cleanup tar.gz
|
||||
os.remove(path)
|
||||
if os.path.exists(path):
|
||||
os.remove(path)
|
||||
|
||||
Reference in New Issue
Block a user