Skip to content

Commit

Permalink
Merge pull request #8037 from atsareg/fix-elastic-job-parameters
Browse files Browse the repository at this point in the history
[8.0]  Fix getting ES configuration
  • Loading branch information
fstagni authored Feb 10, 2025
2 parents 1b77012 + d91c0ba commit 554b37c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/DIRAC/ConfigurationSystem/Client/Utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,9 @@ def _getCACerts(cs_path):
gLogger.debug("Failed to get the configuration parameter: CRT. Using False")
certs = False
else:
certs = result["Value"]
certs = result["Value"].lower() in ("true", "yes", "y", "1")
else:
certs = result["Value"]
certs = result["Value"].lower() in ("true", "yes", "y", "1")
parameters["CRT"] = certs

# If connection is through certificates get the mandatory parameters: ca_certs, client_key, client_cert
Expand Down Expand Up @@ -579,9 +579,9 @@ def _getCACerts(cs_path):
gLogger.debug("Failed to get the configuration parameter: SSL. Assuming SSL is needed")
ssl = True
else:
ssl = False if result["Value"].lower() in ("false", "no", "n") else True
ssl = result["Value"].lower() in ("true", "yes", "y", "1")
else:
ssl = False if result["Value"].lower() in ("false", "no", "n") else True
ssl = result["Value"].lower() in ("true", "yes", "y", "1")
parameters["SSL"] = ssl

return S_OK(parameters)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
from DIRAC.ConfigurationSystem.Client.Helpers import CSGlobals
from DIRAC.Core.Base.ElasticDB import ElasticDB
from DIRAC.Core.Utilities import TimeUtilities
from DIRAC.ConfigurationSystem.Client.Config import gConfig
from DIRAC.ConfigurationSystem.Client.PathFinder import getDatabaseSection

try:
from opensearchpy.exceptions import NotFoundError, RequestError
Expand Down Expand Up @@ -49,7 +51,8 @@ def __init__(self, parentLogger=None):
"""Standard Constructor"""

try:
indexPrefix = CSGlobals.getSetup().lower()
section = getDatabaseSection("WorkloadManagement/ElasticJobParametersDB")
indexPrefix = gConfig.getValue(f"{section}/IndexPrefix", CSGlobals.getSetup()).lower()

# Connecting to the ES cluster
super().__init__(name, "WorkloadManagement/ElasticJobParametersDB", indexPrefix, parentLogger=parentLogger)
Expand Down

0 comments on commit 554b37c

Please sign in to comment.