mirror of
https://github.com/ansible/awx.git
synced 2026-05-11 03:17:38 -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:
|
if not path:
|
||||||
logger.error('Automation Analytics TAR not found')
|
logger.error('Automation Analytics TAR not found')
|
||||||
return
|
return
|
||||||
|
if not os.path.exists(path):
|
||||||
|
logger.error('Automation Analytics TAR {} not found'.format(path))
|
||||||
|
return
|
||||||
if "Error:" in str(path):
|
if "Error:" in str(path):
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
@@ -223,4 +226,5 @@ def ship(path):
|
|||||||
response.text))
|
response.text))
|
||||||
finally:
|
finally:
|
||||||
# cleanup tar.gz
|
# cleanup tar.gz
|
||||||
os.remove(path)
|
if os.path.exists(path):
|
||||||
|
os.remove(path)
|
||||||
|
|||||||
Reference in New Issue
Block a user