mirror of
https://github.com/ansible/awx.git
synced 2026-01-21 14:38:00 -03: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:
parent
1a15f18be3
commit
9f67b6742c
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user