|
22 | 22 |
|
23 | 23 | CE_PROBE_RPMS = ['gratia-probe-htcondor-ce'] |
24 | 24 |
|
25 | | -CONDOR_CE_CONFIG_VAL = "/usr/bin/condor_ce_config_val" |
26 | | - |
27 | 25 |
|
28 | 26 | def requirements_are_installed(): |
29 | 27 | return (utilities.gateway_installed() and |
@@ -246,7 +244,7 @@ def check_attributes(self, attributes): |
246 | 244 | self.log("GratiaConfiguration.check_attributes completed") |
247 | 245 | return True |
248 | 246 | status = self._check_servers() |
249 | | - if 'htcondor-ce' in self._probe_config: |
| 247 | + if 'htcondor-ce' in self._probe_config and requirements_are_installed(): |
250 | 248 | status &= self._verify_gratia_dirs_for_htcondor_ce_probe() |
251 | 249 | self.log("GratiaConfiguration.check_attributes completed") |
252 | 250 | return status |
@@ -441,9 +439,6 @@ def _verify_gratia_dirs_for_htcondor_ce_probe(self) -> bool: |
441 | 439 |
|
442 | 440 | """ |
443 | 441 |
|
444 | | - if not os.path.exists(CONDOR_CE_CONFIG_VAL): |
445 | | - raise exceptions.ConfigureError(f"{CONDOR_CE_CONFIG_VAL} missing") |
446 | | - |
447 | 442 | if self.condor_enabled: |
448 | 443 | history_dir = self._get_condor_history_dir() |
449 | 444 | condor_name = "Condor" |
@@ -494,27 +489,14 @@ def _verify_gratia_dirs_for_htcondor_ce_probe(self) -> bool: |
494 | 489 | self.logger.error(advice_on_error) |
495 | 490 | return False |
496 | 491 |
|
497 | | - def _get_condor_history_dir(self): |
| 492 | + @staticmethod |
| 493 | + def _get_condor_history_dir(): |
498 | 494 | history_dir = utilities.get_condor_config_val("PER_JOB_HISTORY_DIR", subsystem="SCHEDD", quiet_undefined=True) |
499 | 495 | return history_dir |
500 | 496 |
|
501 | | - def _get_condor_ce_history_dir(self): |
502 | | - cmd = [CONDOR_CE_CONFIG_VAL, '-subsystem', 'SCHEDD', 'PER_JOB_HISTORY_DIR'] |
503 | | - try: |
504 | | - process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding="latin-1") |
505 | | - history_dir, errtext = process.communicate() |
506 | | - if process.returncode != 0: |
507 | | - self.logger.info("While checking gratia parameters: %s failed. Output follows:\n%s", |
508 | | - CONDOR_CE_CONFIG_VAL, errtext) |
509 | | - return None |
510 | | - except OSError as err: |
511 | | - self.logger.info("While checking gratia parameters: Error running %s: %s", |
512 | | - CONDOR_CE_CONFIG_VAL, err) |
513 | | - return None |
514 | | - history_dir = history_dir.strip() |
515 | | - if history_dir.startswith('Not defined'): |
516 | | - return None |
517 | | - return history_dir |
| 497 | + @staticmethod |
| 498 | + def _get_condor_ce_history_dir(): |
| 499 | + return utilities.get_condor_ce_config_val("PER_JOB_HISTORY_DIR", subsystem="SCHEDD", quiet_undefined=True) |
518 | 500 |
|
519 | 501 | @staticmethod |
520 | 502 | def replace_setting(buf, setting, value, xml_file=True): |
|
0 commit comments