Skip to content

Commit

Permalink
fix versioning regression, did not check files recursively
Browse files Browse the repository at this point in the history
hit #1431
  • Loading branch information
mirkobrombin committed May 7, 2022
1 parent d47035a commit c814560
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/backend/managers/versioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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

0 comments on commit c814560

Please sign in to comment.