From af41050de19fceb7bc0f947e737d07c56ecd406e Mon Sep 17 00:00:00 2001 From: Mathew Shaker Date: Tue, 29 Oct 2024 21:05:02 +0000 Subject: [PATCH] Add check for any disabled configs when using sr3 start --- sarracenia/sr.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sarracenia/sr.py b/sarracenia/sr.py index 6a3109364..93a3b9372 100755 --- a/sarracenia/sr.py +++ b/sarracenia/sr.py @@ -2233,6 +2233,20 @@ def start(self): if len(self.leftovers) > 0 and not self._action_all_configs: logging.error( f"{self.leftovers} configuration not found" ) return + + has_disabled_config = False + + # if any configs are disabled, don't start any + for f in self.filtered_configurations: + (c, cfg) = f.split(os.sep) + + if self.configs[c][cfg]['status'] == 'disabled': + has_disabled_config = True + logger.error(f"Config {c}/{cfg} is disabled. It must be enabled before starting.") + + if has_disabled_config: + logger.error("No configs have been started due to disabled configurations.") + return pcount = 0 for f in self.filtered_configurations: