Skip to content

Commit

Permalink
Fix to ticket #2310: make loadConfig check for a configfile path in t…
Browse files Browse the repository at this point in the history
…he .tac file if the default location doesn't exist
  • Loading branch information
ian mccowan authored and ian mccowan committed Mar 18, 2013
1 parent 867d954 commit b75a8ef
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion master/buildbot/config.py
Expand Up @@ -117,6 +117,14 @@ def loadConfig(cls, basedir, filename):
"basedir '%s' does not exist" % (basedir,),
])
filename = os.path.join(basedir, filename)
if not os.path.exists(filename):
# execute the .tac file to see if its configfile location exists
tacFile = os.path.join(basedir, 'buildbot.tac')
# don't mess with the global namespace
if os.path.exists(tacFile):
tacGlobals = {}
execfile(tacFile, tacGlobals)
filename = tacGlobals["configfile"]
if not os.path.exists(filename):
raise ConfigErrors([
"configuration file '%s' does not exist" % (filename,),
Expand Down Expand Up @@ -276,7 +284,7 @@ def copy_str_param(name, alt_key=None):
error("codebaseGenerator must be a callable accepting a dict and returning a str")
else:
self.codebaseGenerator = codebaseGenerator

prioritizeBuilders = config_dict.get('prioritizeBuilders')
if prioritizeBuilders is not None and not callable(prioritizeBuilders):
error("prioritizeBuilders must be a callable")
Expand Down

0 comments on commit b75a8ef

Please sign in to comment.