From 68a0d7d6ab512f4682eab2c521bed15dac075b4c Mon Sep 17 00:00:00 2001 From: Jason Secula Date: Sat, 5 Jul 2025 13:28:44 +0200 Subject: [PATCH] added more explicit error when certificate file is missing --- scripts/StagingUserAssignation.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/StagingUserAssignation.py b/scripts/StagingUserAssignation.py index 742ca8e..80403b3 100644 --- a/scripts/StagingUserAssignation.py +++ b/scripts/StagingUserAssignation.py @@ -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)