Skip to content

Commit 26c8291

Browse files
committed
Missed a spot where the function can return None
1 parent d8a2a32 commit 26c8291

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

osg_configure/configure_modules/gratia.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ def _configure_htcondor_ce_probe(self):
426426
return False
427427
return True
428428

429-
def _verify_gratia_dirs_for_htcondor_ce_probe(self):
429+
def _verify_gratia_dirs_for_htcondor_ce_probe(self) -> bool:
430430
"""
431431
Verify that the condor per_job_history directory and the DataFolder
432432
directory are the same and warn if admin if the two don't match
@@ -442,21 +442,20 @@ def _verify_gratia_dirs_for_htcondor_ce_probe(self):
442442
if not match:
443443
return True
444444

445-
valid = True
446445
data_folder = match.group(1)
447446
data_folder = data_folder.strip('" \t')
448447
# Per Gratia-126 DataFolder must end in / otherwise gratia won't find certinfo files
449448
if not data_folder.endswith('/'):
450449
self.logger.error("DataFolder setting in %s must end in a /", config_location)
451-
valid = False
450+
return False
452451

453452
history_dir = self._get_condor_ce_history_dir()
454453
if not history_dir:
455-
self.logger.warning(textwrap.fill(
454+
self.logger.error(textwrap.fill(
456455
"""Could not verify DataFolder correctness: unable to get PER_JOB_HISTORY_DIR
457456
for the schedd. This may be caused by PER_JOB_HISTORY_DIR not being defined."""
458457
))
459-
return valid
458+
return False
460459

461460
# os.path.samefile will die if the paths don't exist so check that explicitly (SOFTWARE-1735)
462461
if not os.path.exists(data_folder):
@@ -468,7 +467,9 @@ def _verify_gratia_dirs_for_htcondor_ce_probe(self):
468467
return False
469468
else:
470469
try:
471-
if not os.path.samefile(data_folder, history_dir):
470+
if os.path.samefile(data_folder, history_dir):
471+
return True
472+
else:
472473
self.logger.error("DataFolder setting in %s (%s) and condor-ce PER_JOB_HISTORY_DIR (%s) "
473474
"do not match, these settings must match!",
474475
config_location, data_folder, history_dir)

0 commit comments

Comments
 (0)