def _get(self, opt, section='general'):
'get value from multi-levels of config file'
+ sect_found = True
+ global gerr
for cfgparser in self._cfgparsers:
try:
return cfgparser.get(section, opt)
except Error as err:
- raise errors.ConfigError(err)
+ sect_found = False
+ gerr = err
+ pass
+
+ if not sect_found:
+ raise errors.ConfigError(gerr)
def options(self, section='general'):
'merge and return options of certain section from multi-levels'
sect_found = False
- global gerr
options = set()
for cfgparser in self._cfgparsers:
try:
options.update(cfgparser.options(section))
sect_found = True
except Error as err:
- raise errors.ConfigError(err)
+ pass
+
+ if not sect_found:
+ raise errors.ConfigError(err)
return options
log.debug("fetching %s => %s" % (url, filename))
- with open(filename, 'w') as outfile:
+ with open(filename, 'wb') as outfile:
self.change_url(url, outfile, user, passwd, no_cache)
self.perform()
fh_gz = open(fname, 'r')
buildconf_file = os.path.join(os.path.dirname(fname),
'build.conf')
- buildconf_fh = open(buildconf_file, 'w')
+ buildconf_fh = open(buildconf_file, 'wb')
buildconf_fh.write(fh_gz.read())
fh_gz.close()
buildconf_fh.close()
from gitbuildsys.errors import GbsError
-GBS = SourceFileLoader("gbs", "../tools/gbs").load_module().main
+GBS = SourceFileLoader("gbs", "./tools/gbs").load_module().main
ENV = {}
TEST_SPEC_CONTENT = """
import tempfile
from nose.tools import eq_
-GBS = SourceFileLoader("gbs", "../tools/gbs").load_module().main
+GBS = SourceFileLoader("gbs", "./tools/gbs").load_module().main
class TestExport(unittest.TestCase):
"""Test export output of gbs commands"""
from nose.tools import eq_
-GBS = SourceFileLoader("gbs", "../tools/gbs").load_module().main
+GBS = SourceFileLoader("gbs", "./tools/gbs").load_module().main
class TestHelp(unittest.TestCase):
"""Test help output of gbs commands"""
from gbp.git.repository import GitRepository
-GBS = SourceFileLoader("gbs", "../tools/gbs").load_module().main
+GBS = SourceFileLoader("gbs", "./tools/gbs").load_module().main
def with_data(fname):
"""