From 06f8a6e438a2ee86def0235a2b0f8cff0e65b2dc Mon Sep 17 00:00:00 2001 From: Andrey Vertiprahov Date: Tue, 8 Mar 2022 23:09:36 +0500 Subject: [PATCH] Catch 'Invalid Script' error on AlarmDiagnostiConfig. --- fm/models/alarmdiagnosticconfig.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fm/models/alarmdiagnosticconfig.py b/fm/models/alarmdiagnosticconfig.py index be505832f9..55c8e9a0d9 100644 --- a/fm/models/alarmdiagnosticconfig.py +++ b/fm/models/alarmdiagnosticconfig.py @@ -208,6 +208,9 @@ class AlarmDiagnosticConfig(Document): try: g = getattr(mo.scripts, c["script"]) result += [g()] + except AttributeError as e: + logger.error("Invalid script %s", c["script"]) + result += [str(e)] except Exception as e: error_report() result += [str(e)] @@ -221,6 +224,9 @@ class AlarmDiagnosticConfig(Document): try: g = getattr(mo.actions, c["action"]) result += [g()] + except AttributeError as e: + logger.error("Invalid action %s", c["action"]) + result += [str(e)] except Exception as e: error_report() result += [str(e)] -- GitLab