From c8145600e6f0a7e1d7386ea14a7801f774e4862c Mon Sep 17 00:00:00 2001 From: mirkobrombin Date: Sat, 7 May 2022 10:48:13 +0200 Subject: [PATCH] fix versioning regression, did not check files recursively hit #1431 --- src/backend/managers/versioning.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/backend/managers/versioning.py b/src/backend/managers/versioning.py index ca8d22df1f2..2eda865a1ea 100644 --- a/src/backend/managers/versioning.py +++ b/src/backend/managers/versioning.py @@ -215,7 +215,7 @@ def create_state( else: new_state_file = { "Update_Date": str(datetime.now()), - "States": {"0": new_state} + "States": {0: new_state} } try: @@ -304,6 +304,7 @@ def get_state_edits( return files except (OSError, IOError, yaml.YAMLError): + logging.error(f"Could not read the state index file.") return {} @staticmethod @@ -324,6 +325,7 @@ def get_state_files( file.close() return files except (OSError, IOError, yaml.YAMLError): + logging.error(f"Could not read the state files file.") return {} @staticmethod @@ -335,7 +337,7 @@ def get_index(config: dict): "Update_Date": str(datetime.now()), "Files": [] } - for file in glob("%s/drive_c/**" % bottle_path): + for file in glob("%s/drive_c/**" % bottle_path, recursive=True): if not os.path.isfile(file): continue @@ -448,6 +450,6 @@ def list_states(config: dict) -> dict: logging.info(f"Found [{len(states)}] states for bottle: [{config['Name']}]", ) except (FileNotFoundError, yaml.YAMLError): - pass + logging.info(f"No states found for bottle: [{config['Name']}]", ) return states