f"Manager is configured to load config file at {config} on startup, but the file does not exist."
)
else:
- logger.info("Loading initial configuration from %s", config)
+ logger.info(f"Loading configuration from '{config}' file.")
config = try_to_parse(await readfile(config))
# validate the initial configuration
async def _load_config(config: Dict[str, Any]) -> KresConfig:
- logger.info("Validating initial configuration...")
config_validated = KresConfig(config)
return config_validated
def _set_working_directory(config_raw: Dict[str, Any]) -> None:
rundir = get_rundir_without_validation(config_raw)
- logger.info("changing working directory to rundir at '%s'", rundir.to_path().absolute())
+ logger.debug(f"Changing working directory to '{rundir.to_path().absolute()}'.")
os.chdir(rundir.to_path())
return self._tree_path
def msg(self):
- return f"[{self.where()}] " + super().__str__()
+ return f"[{self.where()}] {super().__str__()}"
def recursive_msg(self, indentation_level: int = 0) -> str:
+ msg_parts: List[str] = []
+
+ if indentation_level == 0:
+ indentation_level += 1
+ msg_parts.append("Configuration validation error detected:")
+
INDENT = indentation_level * "\t"
- msg_parts: List[str] = [f"{INDENT}{self.msg()}"]
+ msg_parts.append(f"{INDENT}{self.msg()}")
+
for c in self._child_exceptions:
msg_parts.append(c.recursive_msg(indentation_level + 1))
return "\n".join(msg_parts)
msg_parts: List[str] = []
if indentation_level == 0:
inc = 1
- msg_parts.append("multiple configuration errors detected:")
+ msg_parts.append("Configuration validation errors detected:")
for c in self._child_exceptions:
msg_parts.append(c.recursive_msg(indentation_level + inc))