#2151: utilise set_health_state method instead of directly changing software states
This commit is contained in:
@@ -196,7 +196,7 @@ class DatabaseService(Service):
|
||||
return {"status_code": 404, "data": False}
|
||||
elif query == "DELETE":
|
||||
if self.health_state_actual == SoftwareHealthState.GOOD:
|
||||
self.health_state_actual = SoftwareHealthState.COMPROMISED
|
||||
self.set_health_state(SoftwareHealthState.COMPROMISED)
|
||||
return {
|
||||
"status_code": 200,
|
||||
"type": "sql",
|
||||
|
||||
@@ -127,7 +127,7 @@ class Service(IOSoftware):
|
||||
self.operating_state = ServiceOperatingState.RUNNING
|
||||
# set software health state to GOOD if initially set to UNUSED
|
||||
if self.health_state_actual == SoftwareHealthState.UNUSED:
|
||||
self.health_state_actual = SoftwareHealthState.GOOD
|
||||
self.set_health_state(SoftwareHealthState.GOOD)
|
||||
|
||||
def pause(self) -> None:
|
||||
"""Pause the service."""
|
||||
|
||||
Reference in New Issue
Block a user