From 914abf50185b121c82c5181a6ad8cb5d344c110b Mon Sep 17 00:00:00 2001 From: Jason Secula Date: Sat, 5 Jul 2025 13:17:43 +0200 Subject: [PATCH] Added a more explicit error when certificate file is not found --- scripts/syncGLPI.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/syncGLPI.py b/scripts/syncGLPI.py index 585eae4..2f57525 100644 --- a/scripts/syncGLPI.py +++ b/scripts/syncGLPI.py @@ -88,8 +88,12 @@ logger.info("========= Synchronization started =========") try: airwatch = AirwatchAPI(settings) - airwatch.GetDevices() + devices = airwatch.GetDevices() 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: logger.critical(f"Connection to Airwatch server failed : {error}") os.remove(lockFile) @@ -104,9 +108,6 @@ except requests.exceptions.ConnectionError as error: os.remove(lockFile) exit(1) -# Recherche des appareils -devices = airwatch.GetDevices() - logger.info(f"Number of devices found in Airwatch : {len(devices)}") # ====================== Début suppression des doublons ================================= #