Package buildbot :: Package scripts :: Module checkconfig
[frames] | no frames]

Source Code for Module buildbot.scripts.checkconfig

 1  # This file is part of Buildbot.  Buildbot is free software: you can 
 2  # redistribute it and/or modify it under the terms of the GNU General Public 
 3  # License as published by the Free Software Foundation, version 2. 
 4  # 
 5  # This program is distributed in the hope that it will be useful, but WITHOUT 
 6  # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
 7  # FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more 
 8  # details. 
 9  # 
10  # You should have received a copy of the GNU General Public License along with 
11  # this program; if not, write to the Free Software Foundation, Inc., 51 
12  # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 
13  # 
14  # Copyright Buildbot Team Members 
15   
16  import sys 
17  import os 
18  from buildbot import config 
19   
20 -class ConfigLoader(object):
21 - def __init__(self, basedir=os.getcwd(), configFileName="master.cfg"):
22 self.basedir = os.path.abspath(basedir) 23 self.configFileName = os.path.abspath( 24 os.path.join(basedir, configFileName))
25
26 - def load(self, quiet=False):
27 try: 28 config.MasterConfig.loadConfig( 29 self.basedir, self.configFileName) 30 except config.ConfigErrors, e: 31 if not quiet: 32 print >> sys.stderr, "Configuration Errors:" 33 for e in e.errors: 34 print >> sys.stderr, " " + e 35 return 1 36 37 if not quiet: 38 print "Config file is good!" 39 return 0
40