Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.0] fix: look also for DIRAC.rootPath/etc/dirac.cfg #7137

Merged
merged 1 commit into from
Aug 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/DIRAC/ConfigurationSystem/Client/LocalConfiguration.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ def disableParsingCommandLine(self):
def __getAbsolutePath(self, optionPath):
if optionPath[0] == "/":
return optionPath
else:
return f"{self.currentSectionPath}/{optionPath}"
return f"{self.currentSectionPath}/{optionPath}"

def addMandatoryEntry(self, optionPath):
"""
Expand Down Expand Up @@ -446,8 +445,9 @@ def __loadCFGFiles(self):
Loads possibly several cfg files, in order:
1. cfg files pointed by DIRACSYSCONFIG env variable (comma-separated)
2. ~/.dirac.cfg
3. cfg files specified in addCFGFile calls
4. cfg files that come from the command line
3. DIRAC.rootPath/etc/dirac.cfg
4. cfg files specified in addCFGFile calls
5. cfg files that come from the command line
"""
errorsList = []
foundCFGFile = False
Expand All @@ -466,7 +466,11 @@ def __loadCFGFiles(self):
foundCFGFile = True
gConfigurationData.loadFile(os.path.expanduser("~/.dirac.cfg"))

# 3. cfg files specified in addCFGFile calls
# 3. defaultCFGFile = os.path.join(DIRAC.rootPath, "etc", "dirac.cfg")
if os.path.isfile(os.path.join(DIRAC.rootPath, "etc", "dirac.cfg")):
foundCFGFile = True

# 4. cfg files specified in addCFGFile calls
for fileName in self.additionalCFGFiles:
if os.path.isfile(fileName):
foundCFGFile = True
Expand All @@ -476,7 +480,7 @@ def __loadCFGFiles(self):
gLogger.debug(f"Could not load file {fileName}: {retVal['Message']}")
errorsList.append(retVal["Message"])

# 4. cfg files that come from the command line
# 5. cfg files that come from the command line
for fileName in self.cliAdditionalCFGFiles:
if os.path.isfile(fileName):
foundCFGFile = True
Expand Down
Loading