added more explicit error when certificate file is missing
This commit is contained in:
@ -78,15 +78,18 @@ else:
|
||||
# Initialisation de l'api Airwatch
|
||||
try:
|
||||
airwatch = AirwatchAPI(settings)
|
||||
# Recherche des appareils filtré sur l'utilisateur de staging
|
||||
devices = airwatch.GetDevices(stagingUser)
|
||||
logger.info("Airwatch server connection succeeded")
|
||||
except requests.exceptions.ConnectionError as error:
|
||||
except FileNotFoundError as F:
|
||||
logger.critical(f"Certificate file not found for CMSURL authentication : {F}")
|
||||
os.remove(lockFile)
|
||||
exit(1)
|
||||
except Exception as error:
|
||||
logger.critical(f"Connection to Airwatch server failed : {error}")
|
||||
os.remove(lockFile)
|
||||
exit(1)
|
||||
|
||||
# Recherche des appareils filtré sur l'utilisateur de staging
|
||||
devices = airwatch.GetDevices(stagingUser)
|
||||
|
||||
if(devices == None):
|
||||
logger.info(f"No device found with staging user ({stagingUser}), exiting...")
|
||||
os.remove(lockFile)
|
||||
|
||||
Reference in New Issue
Block a user