Added a more explicit error when certificate file is not found
This commit is contained in:
@ -88,8 +88,12 @@ logger.info("========= Synchronization started =========")
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
airwatch = AirwatchAPI(settings)
|
airwatch = AirwatchAPI(settings)
|
||||||
airwatch.GetDevices()
|
devices = airwatch.GetDevices()
|
||||||
logger.info("Airwatch server connection succeeded")
|
logger.info("Airwatch server connection succeeded")
|
||||||
|
except FileNotFoundError as F:
|
||||||
|
logger.critical(f"Certificate file not found for CMSURL authentication : {F}")
|
||||||
|
os.remove(lockFile)
|
||||||
|
exit(1)
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
logger.critical(f"Connection to Airwatch server failed : {error}")
|
logger.critical(f"Connection to Airwatch server failed : {error}")
|
||||||
os.remove(lockFile)
|
os.remove(lockFile)
|
||||||
@ -104,9 +108,6 @@ except requests.exceptions.ConnectionError as error:
|
|||||||
os.remove(lockFile)
|
os.remove(lockFile)
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
# Recherche des appareils
|
|
||||||
devices = airwatch.GetDevices()
|
|
||||||
|
|
||||||
logger.info(f"Number of devices found in Airwatch : {len(devices)}")
|
logger.info(f"Number of devices found in Airwatch : {len(devices)}")
|
||||||
|
|
||||||
# ====================== Début suppression des doublons ================================= #
|
# ====================== Début suppression des doublons ================================= #
|
||||||
|
|||||||
Reference in New Issue
Block a user