generate: container: Drop or change removed log functions
Either drop the invocations or change them to log_error(). Signed-off-by: Enno Tensing <tenno@suij.in>
This commit is contained in:
parent
d097cedc6b
commit
acacf19a12
1 changed files with 5 additions and 9 deletions
|
@ -34,23 +34,21 @@ def load_container_config(file: Path, log: Log) -> dict | None:
|
|||
data = json.load(fp)
|
||||
except json.JSONDecodeError as e:
|
||||
log.log_error(f"{file.name} is not a valid JSON file!")
|
||||
log.log_debug(f"Exception: {e}")
|
||||
log.log_error(f"Exception: {e}")
|
||||
return None
|
||||
except UnicodeDecodeError as e:
|
||||
log.log_error(f"{file.name} is not a valid UTF8 file!")
|
||||
log.log_debug(f"Exception: {e}")
|
||||
log.log_error(f"Exception: {e}")
|
||||
return None
|
||||
except OSError as e:
|
||||
log.log_error(f"{file.name} could not be read!")
|
||||
log.log_debug(f"Exception: {e}")
|
||||
log.log_error(f"Exception: {e}")
|
||||
return None
|
||||
return data
|
||||
|
||||
|
||||
def create_container_from_config(data: dict, log: Log) -> Container | None:
|
||||
"""Create a container object."""
|
||||
log.log_info("Creating container...")
|
||||
log.log_debug(f"Container config is:\n{data}")
|
||||
ct: Container | None = None
|
||||
try:
|
||||
ct = Container(data)
|
||||
|
@ -82,10 +80,8 @@ def main() -> None:
|
|||
if data is None:
|
||||
logger.log_error(f"{config_file} is invalid, aborting!")
|
||||
sys.exit(1)
|
||||
try:
|
||||
ct = create_container_from_config(data, logger)
|
||||
except ConfigError as e:
|
||||
logger.log_error(e)
|
||||
ct = create_container_from_config(data, logger)
|
||||
if ct is None:
|
||||
sys.exit(1)
|
||||
scripts = {
|
||||
"create-volumes": ct.create_volumes,
|
||||
|
|
Loading…
Add table
Reference in a new issue