#1947: remove scan from components that cannot be scanned

This commit is contained in:
Czar.Echavez
2023-10-24 10:43:00 +01:00
parent 8b85d5d55b
commit 1e66795aff
4 changed files with 3 additions and 19 deletions

View File

@@ -196,10 +196,6 @@ class SimComponent(BaseModel):
}
return state
def scan(self) -> None:
"""Update the visible statuses of the SimComponent."""
pass
def apply_request(self, request: List[str], context: Dict = {}) -> None:
"""
Apply a request to a simulation component. Request data is passed in as a 'namespaced' list of strings.

View File

@@ -119,12 +119,6 @@ class FileSystemItemABC(SimComponent):
"""
return convert_size(self.size)
def scan(self) -> None:
"""Update the FileSystemItem states."""
super().scan()
self.visible_health_status = self.health_status
@abstractmethod
def check_hash(self) -> bool:
"""
@@ -514,6 +508,8 @@ class Folder(FileSystemItemABC):
# scan one file per timestep
file = self.get_file_by_id(file_uuid=list(self.files)[self.scan_duration - 1])
file.scan()
if file.visible_health_status == FileSystemItemHealthStatus.CORRUPTED:
self.visible_health_status = FileSystemItemHealthStatus.CORRUPTED
self.scan_duration -= 1
def get_file(self, file_name: str) -> Optional[File]:
@@ -613,8 +609,6 @@ class Folder(FileSystemItemABC):
def scan(self) -> None:
"""Update Folder visible status."""
super().scan()
if self.scan_duration <= -1:
# scan one file per timestep
self.scan_duration = len(self.files)
@@ -799,10 +793,9 @@ class File(FileSystemItemABC):
def scan(self) -> None:
"""Updates the visible statuses of the file."""
super().scan()
path = self.folder.name + "/" + self.name
self.folder.fs.sys_log.info(f"Scanning file {self.sim_path if self.sim_path else path}")
self.visible_health_status = self.health_status
def check_hash(self) -> bool:
"""

View File

@@ -84,9 +84,6 @@ class Service(IOSoftware):
def scan(self) -> None:
"""Update the service visible states."""
# update parent states
super().scan()
# update the visible operating state
self.health_state_visible = self.health_state_actual

View File

@@ -175,8 +175,6 @@ class Software(SimComponent):
def scan(self) -> None:
"""Update the observed health status to match the actual health status."""
super().scan()
self.health_state_visible = self.health_state_actual