Skip to content

Commit c68f2be

Browse files
fstagniweb-flow
authored andcommitted
sweep: #7137 fix: look also for DIRAC.rootPath/etc/dirac.cfg
1 parent 1ce2827 commit c68f2be

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/DIRAC/ConfigurationSystem/Client/LocalConfiguration.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,9 @@ def __loadCFGFiles(self):
447447
Loads possibly several cfg files, in order:
448448
1. cfg files pointed by DIRACSYSCONFIG env variable (comma-separated)
449449
2. ~/.dirac.cfg
450-
3. cfg files specified in addCFGFile calls
451-
4. cfg files that come from the command line
450+
3. DIRAC.rootPath/etc/dirac.cfg
451+
4. cfg files specified in addCFGFile calls
452+
5. cfg files that come from the command line
452453
"""
453454
errorsList = []
454455
foundCFGFile = False
@@ -467,7 +468,11 @@ def __loadCFGFiles(self):
467468
foundCFGFile = True
468469
gConfigurationData.loadFile(os.path.expanduser("~/.dirac.cfg"))
469470

470-
# 3. cfg files specified in addCFGFile calls
471+
# 3. defaultCFGFile = os.path.join(DIRAC.rootPath, "etc", "dirac.cfg")
472+
if os.path.isfile(os.path.join(DIRAC.rootPath, "etc", "dirac.cfg")):
473+
foundCFGFile = True
474+
475+
# 4. cfg files specified in addCFGFile calls
471476
for fileName in self.additionalCFGFiles:
472477
if os.path.isfile(fileName):
473478
foundCFGFile = True
@@ -477,7 +482,7 @@ def __loadCFGFiles(self):
477482
gLogger.debug(f"Could not load file {fileName}: {retVal['Message']}")
478483
errorsList.append(retVal["Message"])
479484

480-
# 4. cfg files that come from the command line
485+
# 5. cfg files that come from the command line
481486
for fileName in self.cliAdditionalCFGFiles:
482487
if os.path.isfile(fileName):
483488
foundCFGFile = True

0 commit comments

Comments
 (0)