]> git.ipfire.org Git - nitsi.git/blobdiff - src/nitsi/test.py
Make config parsing more robust against errors
[nitsi.git] / src / nitsi / test.py
index 97330c223240327ec0b44363783708811625b3a5..8d29e3047cb57209580d62325b51b6b1376ba319 100755 (executable)
@@ -40,8 +40,13 @@ class Test():
             raise TestException("No recipe file found")
 
     def read_settings(self):
             raise TestException("No recipe file found")
 
     def read_settings(self):
-        self.config = configparser.ConfigParser()
-        self.config.read(self.settings_file)
+        try:
+            self.config = configparser.ConfigParser()
+            self.config.read(self.settings_file)
+        except BaseException as e:
+            self.log.error("Failed to parse the config")
+            raise e
+
         self.name = self.config["DEFAULT"]["name"]
         self.description = self.config["DEFAULT"]["description"]
         self.copy_to = self.config["DEFAULT"]["copy_to"]
         self.name = self.config["DEFAULT"]["name"]
         self.description = self.config["DEFAULT"]["description"]
         self.copy_to = self.config["DEFAULT"]["copy_to"]