From 0fa9fa32bc0abd08b7cab3bda129707b75d9732e Mon Sep 17 00:00:00 2001 From: Nick Todd Date: Thu, 25 Apr 2024 16:20:57 +0100 Subject: [PATCH] #2299: Add not implemented warning message. --- src/primaite/simulator/file_system/file.py | 6 +++++- src/primaite/simulator/file_system/folder.py | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/primaite/simulator/file_system/file.py b/src/primaite/simulator/file_system/file.py index 52fe4f85..a4d54e79 100644 --- a/src/primaite/simulator/file_system/file.py +++ b/src/primaite/simulator/file_system/file.py @@ -3,6 +3,7 @@ from __future__ import annotations import hashlib import json import os.path +import warnings from pathlib import Path from typing import Dict, Optional @@ -145,6 +146,10 @@ class File(FileSystemItemABC): Return False if corruption is detected, otherwise True """ + warnings.warn("NODE_FILE_CHECKHASH is currently not implemented.") + self.sys_log.warning("NODE_FILE_CHECKHASH is currently not implemented.") + return False + if self.deleted: self.sys_log.error(f"Unable to check hash of deleted file {self.folder_name}/{self.name}") return False @@ -169,7 +174,6 @@ class File(FileSystemItemABC): # if the previous hash and current hash do not match, mark file as corrupted if self.previous_hash is not current_hash: self.corrupt() - return True def repair(self) -> bool: diff --git a/src/primaite/simulator/file_system/folder.py b/src/primaite/simulator/file_system/folder.py index 9f176660..0e693a25 100644 --- a/src/primaite/simulator/file_system/folder.py +++ b/src/primaite/simulator/file_system/folder.py @@ -1,5 +1,6 @@ from __future__ import annotations +import warnings from typing import Dict, Optional from prettytable import MARKDOWN, PrettyTable @@ -383,6 +384,10 @@ class Folder(FileSystemItemABC): Return False if corruption is detected, otherwise True """ + warnings.warn("NODE_FOLDER_CHECKHASH is currently not implemented.") + self.sys_log.error("NODE_FOLDER_CHECKHASH is currently not implemented.") + return False + if self.deleted: self.sys_log.error(f"Unable to check hash of deleted folder {self.name}") return False