#2725: apply PR suggestions

This commit is contained in:
Czar Echavez
2024-07-03 10:34:44 +01:00
parent fcd1209156
commit 55c457a87d

View File

@@ -298,9 +298,8 @@ class PrimaiteGame:
new_service = new_node.software_manager.software[service_type]
# fixing duration for the service
fix_duration = service_cfg.get("options", {}).get("fix_duration", None)
if fix_duration:
new_service.fixing_duration = fix_duration
if "fix_duration" in service_cfg.get("options", {}):
new_service.fixing_duration = service_cfg["options"]["fix_duration"]
# start the service
new_service.start()
@@ -343,9 +342,8 @@ class PrimaiteGame:
new_application = new_node.software_manager.software[application_type]
# fixing duration for the application
fix_duration = application_cfg.get("options", {}).get("fix_duration", None)
if fix_duration:
new_application.fixing_duration = fix_duration
if "fix_duration" in application_cfg.get("options", {}):
new_application.fixing_duration = application_cfg["options"]["fix_duration"]
else:
msg = f"Configuration contains an invalid application type: {application_type}"
_LOGGER.error(msg)