diff --git a/apps/cli/executables/pexable/casa_envoy/casa_envoy/auditor.py b/apps/cli/executables/pexable/casa_envoy/casa_envoy/auditor.py index 85feb6899d7a44c274b5c0c4a9ebc947fe0a9b9a..f182017ba070e89528949b6b988c6b84a39e204a 100644 --- a/apps/cli/executables/pexable/casa_envoy/casa_envoy/auditor.py +++ b/apps/cli/executables/pexable/casa_envoy/casa_envoy/auditor.py @@ -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() diff --git a/apps/cli/executables/pexable/casa_envoy/casa_envoy/launchers.py b/apps/cli/executables/pexable/casa_envoy/casa_envoy/launchers.py index a98f38f38008f1625ea9956e928fc36ed89eb2a0..bd33001c252d9ae57da30ccdb55b5089060fc915 100644 --- a/apps/cli/executables/pexable/casa_envoy/casa_envoy/launchers.py +++ b/apps/cli/executables/pexable/casa_envoy/casa_envoy/launchers.py @@ -50,7 +50,7 @@ class CasaLauncher: self.logger.info(f"{var}: {env}") if "None" in result_list: - self.logger.info("Environment setup Failed!") + self.logger.error("Environment setup Failed!") sys.exit(1) else: self.logger.info("Environment ready for processing") @@ -189,7 +189,7 @@ class ImagingLauncher(LauncherIF): if cms_name is not None and cms_path is not None and cms_name[-3:] == ".ms": return True else: - self.logger.info("CMS ERROR: Imaging requires a valid CMS name and location!") + self.logger.error("CMS ERROR: Imaging requires a valid CMS name and location!") return False def check_cal_and_imageable(self) -> bool: @@ -219,12 +219,12 @@ class ImagingLauncher(LauncherIF): if dir_audit: self.logger.info("Directory audit successful!") else: - self.logger.info("FAILURE: directory structure audit was unsuccessful!") + self.logger.error("FAILURE: directory structure audit was unsuccessful!") sys.exit(1) audit = AuditFiles([self.ppr, self.metadata], parameters).audit() if audit: self.logger.info("File audit successful!") else: - self.logger.info("FAILURE: file audit was unsuccessful!") + self.logger.error("FAILURE: file audit was unsuccessful!") sys.exit(1) diff --git a/apps/cli/executables/pexable/casa_envoy/test/test_auditor.py b/apps/cli/executables/pexable/casa_envoy/test/test_auditor.py index f5ed148b1306aaa1a29d6db38bb2d7995887b427..c55e1682fce27ea21c8d73a515f405e479f1cc2e 100644 --- a/apps/cli/executables/pexable/casa_envoy/test/test_auditor.py +++ b/apps/cli/executables/pexable/casa_envoy/test/test_auditor.py @@ -72,8 +72,8 @@ def test_get_fields_for(): "creationTime", "productLocator", "destinationDirectory", - "cms_path", - "sdmId", + "calibrationSourceDirectory", + "cmsName", ] result = get_fields_for(product_type=product_type2, filename=test_img_metadata.filename) assert result == img_fields