From e5804ca13563c3945c3d0388d315ddfee3131d78 Mon Sep 17 00:00:00 2001 From: dbeltran Date: Mon, 16 Dec 2024 14:58:49 +0100 Subject: [PATCH] Address feedback --- VERSION | 2 +- autosubmitconfigparser/config/configcommon.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/VERSION b/VERSION index e9acec7..e7468c7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.75 +1.0.76 diff --git a/autosubmitconfigparser/config/configcommon.py b/autosubmitconfigparser/config/configcommon.py index 26ad0d1..5c5126d 100644 --- a/autosubmitconfigparser/config/configcommon.py +++ b/autosubmitconfigparser/config/configcommon.py @@ -557,14 +557,14 @@ def _normalize_notify_on(data_fixed: dict, job_section) -> None: """ Normalize the NOTIFY_ON section to a consistent format. """ - if "NOTIFY_ON" in data_fixed["JOBS"][job_section]: - if type(data_fixed["JOBS"][job_section]["NOTIFY_ON"]) is str: - if "," in data_fixed["JOBS"][job_section]["NOTIFY_ON"]: - data_fixed["JOBS"][job_section]["NOTIFY_ON"] = [status.strip(" ").upper() for status in data_fixed["JOBS"][job_section]["NOTIFY_ON"].split(",")] + notify_on = data_fixed["JOBS"][job_section].get("NOTIFY_ON", "") + if notify_on: + if type(notify_on) is str: + if "," in notify_on: + notify_on = notify_on.split(",") else: - data_fixed["JOBS"][job_section]["NOTIFY_ON"] = [status.strip(" ").upper() for status in data_fixed["JOBS"][job_section]["NOTIFY_ON"].split()] - else: - data_fixed["JOBS"][job_section]["NOTIFY_ON"] = [status.strip(" ").upper() for status in data_fixed["JOBS"][job_section]["NOTIFY_ON"]] + notify_on = notify_on.split() + data_fixed["JOBS"][job_section]["NOTIFY_ON"] = [status.strip(" ").upper() for status in notify_on] def _normalize_jobs_section(self, data_fixed: dict, must_exists: bool ) -> None: for job, job_data in data_fixed.get("JOBS", {}).items():