#1947: remove scan from components that cannot be scanned
This commit is contained in:
@@ -196,10 +196,6 @@ class SimComponent(BaseModel):
|
|||||||
}
|
}
|
||||||
return state
|
return state
|
||||||
|
|
||||||
def scan(self) -> None:
|
|
||||||
"""Update the visible statuses of the SimComponent."""
|
|
||||||
pass
|
|
||||||
|
|
||||||
def apply_request(self, request: List[str], context: Dict = {}) -> None:
|
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.
|
Apply a request to a simulation component. Request data is passed in as a 'namespaced' list of strings.
|
||||||
|
|||||||
@@ -119,12 +119,6 @@ class FileSystemItemABC(SimComponent):
|
|||||||
"""
|
"""
|
||||||
return convert_size(self.size)
|
return convert_size(self.size)
|
||||||
|
|
||||||
def scan(self) -> None:
|
|
||||||
"""Update the FileSystemItem states."""
|
|
||||||
super().scan()
|
|
||||||
|
|
||||||
self.visible_health_status = self.health_status
|
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def check_hash(self) -> bool:
|
def check_hash(self) -> bool:
|
||||||
"""
|
"""
|
||||||
@@ -514,6 +508,8 @@ class Folder(FileSystemItemABC):
|
|||||||
# scan one file per timestep
|
# scan one file per timestep
|
||||||
file = self.get_file_by_id(file_uuid=list(self.files)[self.scan_duration - 1])
|
file = self.get_file_by_id(file_uuid=list(self.files)[self.scan_duration - 1])
|
||||||
file.scan()
|
file.scan()
|
||||||
|
if file.visible_health_status == FileSystemItemHealthStatus.CORRUPTED:
|
||||||
|
self.visible_health_status = FileSystemItemHealthStatus.CORRUPTED
|
||||||
self.scan_duration -= 1
|
self.scan_duration -= 1
|
||||||
|
|
||||||
def get_file(self, file_name: str) -> Optional[File]:
|
def get_file(self, file_name: str) -> Optional[File]:
|
||||||
@@ -613,8 +609,6 @@ class Folder(FileSystemItemABC):
|
|||||||
|
|
||||||
def scan(self) -> None:
|
def scan(self) -> None:
|
||||||
"""Update Folder visible status."""
|
"""Update Folder visible status."""
|
||||||
super().scan()
|
|
||||||
|
|
||||||
if self.scan_duration <= -1:
|
if self.scan_duration <= -1:
|
||||||
# scan one file per timestep
|
# scan one file per timestep
|
||||||
self.scan_duration = len(self.files)
|
self.scan_duration = len(self.files)
|
||||||
@@ -799,10 +793,9 @@ class File(FileSystemItemABC):
|
|||||||
|
|
||||||
def scan(self) -> None:
|
def scan(self) -> None:
|
||||||
"""Updates the visible statuses of the file."""
|
"""Updates the visible statuses of the file."""
|
||||||
super().scan()
|
|
||||||
|
|
||||||
path = self.folder.name + "/" + self.name
|
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.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:
|
def check_hash(self) -> bool:
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -84,9 +84,6 @@ class Service(IOSoftware):
|
|||||||
|
|
||||||
def scan(self) -> None:
|
def scan(self) -> None:
|
||||||
"""Update the service visible states."""
|
"""Update the service visible states."""
|
||||||
# update parent states
|
|
||||||
super().scan()
|
|
||||||
|
|
||||||
# update the visible operating state
|
# update the visible operating state
|
||||||
self.health_state_visible = self.health_state_actual
|
self.health_state_visible = self.health_state_actual
|
||||||
|
|
||||||
|
|||||||
@@ -175,8 +175,6 @@ class Software(SimComponent):
|
|||||||
|
|
||||||
def scan(self) -> None:
|
def scan(self) -> None:
|
||||||
"""Update the observed health status to match the actual health status."""
|
"""Update the observed health status to match the actual health status."""
|
||||||
super().scan()
|
|
||||||
|
|
||||||
self.health_state_visible = self.health_state_actual
|
self.health_state_visible = self.health_state_actual
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user