#917 - Integrated the PrimaiteSession into all tests.
- Ran a full pre-commit hook and thus encountered tons of fixes required
This commit is contained in:
@@ -87,7 +87,9 @@ class ActiveNode(Node):
|
||||
f"Node.software_state:{self._software_state}"
|
||||
)
|
||||
|
||||
def set_software_state_if_not_compromised(self, software_state: SoftwareState):
|
||||
def set_software_state_if_not_compromised(
|
||||
self, software_state: SoftwareState
|
||||
):
|
||||
"""
|
||||
Sets Software State if the node is not compromised.
|
||||
|
||||
@@ -98,7 +100,9 @@ class ActiveNode(Node):
|
||||
if self._software_state != SoftwareState.COMPROMISED:
|
||||
self._software_state = software_state
|
||||
if software_state == SoftwareState.PATCHING:
|
||||
self.patching_count = self.config_values.os_patching_duration
|
||||
self.patching_count = (
|
||||
self.config_values.os_patching_duration
|
||||
)
|
||||
else:
|
||||
_LOGGER.info(
|
||||
f"The Nodes hardware state is OFF so OS State cannot be changed."
|
||||
@@ -187,7 +191,9 @@ class ActiveNode(Node):
|
||||
def start_file_system_scan(self):
|
||||
"""Starts a file system scan."""
|
||||
self.file_system_scanning = True
|
||||
self.file_system_scanning_count = self.config_values.file_system_scanning_limit
|
||||
self.file_system_scanning_count = (
|
||||
self.config_values.file_system_scanning_limit
|
||||
)
|
||||
|
||||
def update_file_system_state(self):
|
||||
"""Updates file system status based on scanning/restore/repair cycle."""
|
||||
@@ -206,7 +212,10 @@ class ActiveNode(Node):
|
||||
self.file_system_state_observed = FileSystemState.GOOD
|
||||
|
||||
# Scanning updates
|
||||
if self.file_system_scanning == True and self.file_system_scanning_count < 0:
|
||||
if (
|
||||
self.file_system_scanning == True
|
||||
and self.file_system_scanning_count < 0
|
||||
):
|
||||
self.file_system_state_observed = self.file_system_state_actual
|
||||
self.file_system_scanning = False
|
||||
self.file_system_scanning_count = 0
|
||||
|
||||
@@ -32,7 +32,9 @@ class NodeStateInstructionGreen(object):
|
||||
self.end_step = _end_step
|
||||
self.node_id = _node_id
|
||||
self.node_pol_type = _node_pol_type
|
||||
self.service_name = _service_name # Not used when not a service instruction
|
||||
self.service_name = (
|
||||
_service_name # Not used when not a service instruction
|
||||
)
|
||||
self.state = _state
|
||||
|
||||
def get_start_step(self):
|
||||
|
||||
@@ -42,7 +42,9 @@ class NodeStateInstructionRed(object):
|
||||
self.target_node_id = _target_node_id
|
||||
self.initiator = _pol_initiator
|
||||
self.pol_type: NodePOLType = _pol_type
|
||||
self.service_name = pol_protocol # Not used when not a service instruction
|
||||
self.service_name = (
|
||||
pol_protocol # Not used when not a service instruction
|
||||
)
|
||||
self.state = _pol_state
|
||||
self.source_node_id = _pol_source_node_id
|
||||
self.source_node_service = _pol_source_node_service
|
||||
|
||||
@@ -110,7 +110,9 @@ class ServiceNode(ActiveNode):
|
||||
return False
|
||||
return False
|
||||
|
||||
def set_service_state(self, protocol_name: str, software_state: SoftwareState):
|
||||
def set_service_state(
|
||||
self, protocol_name: str, software_state: SoftwareState
|
||||
):
|
||||
"""
|
||||
Sets the software_state of a service (protocol) on the node.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user