diff --git a/npbackup/upgrade_client/upgrader.py b/npbackup/upgrade_client/upgrader.py index 0f415ac..41a9321 100644 --- a/npbackup/upgrade_client/upgrader.py +++ b/npbackup/upgrade_client/upgrader.py @@ -159,6 +159,9 @@ def auto_upgrader( except (KeyError, TypeError): logger.error("Cannot get file description") return False + if sha256sum is None: + logger.info("No upgrade file found for me") + return False file_data = requestor.requestor("download/" + id_record, raw=True) if not file_data: diff --git a/upgrade_server/upgrade_server/crud.py b/upgrade_server/upgrade_server/crud.py index 19aa82f..3471e59 100644 --- a/upgrade_server/upgrade_server/crud.py +++ b/upgrade_server/upgrade_server/crud.py @@ -96,7 +96,15 @@ def get_file(file: FileGet, content: bool = False) -> Optional[Union[FileSend, b ) logger.info("Searching for %s", path) if not os.path.isfile(path): - return None + logger.info(f"No upgrade file found in {path}") + return FileSend( + arch=file.arch.value, + platform=file.platform.value, + sha256sum=None, + filename=None, + file_length=0, + ) + with open(path, "rb") as fh: bytes = fh.read() if content: