Skip to content
Snippets Groups Projects

Post Server Apocalypse Round 2

Merged Charlotte Hausman requested to merge testing_barrage_fixes into main
Files
3
@@ -30,8 +30,8 @@ def get_fields_for(product_type: str, filename: str) -> list:
"creationTime",
"productLocator",
"destinationDirectory",
"cms_path",
"sdmId",
"calibrationSourceDirectory",
"cmsName",
]
restore_metadata_list = [
@@ -85,7 +85,7 @@ class AuditFiles(AuditorIF):
if ".json" in file.filename:
for tag in fields:
if tag not in content or len(json.loads(content)[tag]) == 0:
if tag not in content:
missing.append(tag)
if len(missing) > 0:
print(f"Missing fields: {missing}")
@@ -123,7 +123,7 @@ class AuditFiles(AuditorIF):
invalid_files.append(file.filename)
if len(invalid_files) != 0:
self.logger.info(f"INVALID FILE FOUND: {invalid_files}")
self.logger.error(f"INVALID FILE FOUND: {invalid_files}")
return False
else:
return True
@@ -142,7 +142,7 @@ class AuditDirectories(AuditorIF):
current = os.getcwd()
needed = self.rootDirectory + "/" + self.relative_path
if needed != current:
self.logger.info("DIRECTORY ERROR: not in correct directory for processing.")
self.logger.error("DIRECTORY ERROR: not in correct directory for processing.")
return False
else:
working = Path(current + "/working").is_dir()
Loading