@@ -69,6 +69,7 @@ def __init__(self, *args, **kwargs):
69
69
self ._old_job_managers = ['pbs' , 'sge' , 'lsf' , 'condor' , 'slurm' ]
70
70
self ._probe_config = {}
71
71
self .grid_group = 'OSG'
72
+ self .condor_enabled = False
72
73
73
74
self .log ("GratiaConfiguration.__init__ completed" )
74
75
@@ -126,6 +127,10 @@ def parse_configuration(self, configuration):
126
127
return
127
128
128
129
self ._set_enabled_probe_host (self .options ['probes' ].value )
130
+
131
+ if utilities .config_safe_getboolean (configuration , "Condor" , "enabled" ):
132
+ self .condor_enabled = True
133
+
129
134
self .log ('GratiaConfiguration.parse_configuration completed' )
130
135
131
136
def configure (self , attributes ):
@@ -429,13 +434,22 @@ def _configure_htcondor_ce_probe(self):
429
434
def _verify_gratia_dirs_for_htcondor_ce_probe (self ) -> bool :
430
435
"""
431
436
Verify that the HTCondor-CE PER_JOB_HISTORY_DIR and the DataFolder
432
- directory are the same and warn the admin if the two don't match
437
+ directory are the same and warn the admin if the two don't match.
438
+
439
+ If the batch system is condor, look at its PER_JOB_HISTORY_DIR instead;
440
+ we want the routed jobs, but those are moved to the batch system schedd.
441
+
433
442
"""
434
443
435
444
if not os .path .exists (CONDOR_CE_CONFIG_VAL ):
436
445
raise exceptions .ConfigureError (f"{ CONDOR_CE_CONFIG_VAL } missing" )
437
446
438
- history_dir = self ._get_condor_ce_history_dir ()
447
+ if self .condor_enabled :
448
+ history_dir = self ._get_condor_history_dir ()
449
+ condor_name = "Condor"
450
+ else :
451
+ history_dir = self ._get_condor_ce_history_dir ()
452
+ condor_name = "HTCondor-CE"
439
453
440
454
config_location = GRATIA_CONFIG_FILES ['htcondor-ce' ]
441
455
contents = utilities .read_file (config_location , default = "" )
@@ -445,7 +459,7 @@ def _verify_gratia_dirs_for_htcondor_ce_probe(self) -> bool:
445
459
446
460
advice_on_error = (
447
461
f"Make sure DataFolder in { config_location } ({ data_folder or 'missing' } )"
448
- f" and PER_JOB_HISTORY_DIR in the HTCondor-CE config ({ history_dir or 'missing' } )"
462
+ f" and PER_JOB_HISTORY_DIR in the { condor_name } config ({ history_dir or 'missing' } )"
449
463
f" exist and are the same, accessible directory."
450
464
)
451
465
@@ -480,6 +494,10 @@ def _verify_gratia_dirs_for_htcondor_ce_probe(self) -> bool:
480
494
self .logger .error (advice_on_error )
481
495
return False
482
496
497
+ def _get_condor_history_dir (self ):
498
+ history_dir = utilities .get_condor_config_val ("PER_JOB_HISTORY_DIR" , subsystem = "SCHEDD" , quiet_undefined = True )
499
+ return history_dir
500
+
483
501
def _get_condor_ce_history_dir (self ):
484
502
cmd = [CONDOR_CE_CONFIG_VAL , '-subsystem' , 'SCHEDD' , 'PER_JOB_HISTORY_DIR' ]
485
503
try :
0 commit comments