def _get(self, opt, section='general'):
'get value from multi-levels of config file'
sect_found = True
- global gerr
+ gerr = None
for cfgparser in self._cfgparsers:
try:
return cfgparser.get(section, opt)
def options(self, section='general'):
'merge and return options of certain section from multi-levels'
sect_found = False
+ gerr = None
options = set()
for cfgparser in self._cfgparsers:
try:
options.update(cfgparser.options(section))
sect_found = True
except Error as err:
+ gerr = err
pass
if not sect_found:
if oscrc:
try:
conf.get_config(override_conffile=oscrc)
+ except urllib.error.URLError:
+ raise ObsError("invalid service apiurl: %s" % apiurl)
except OSError as err:
if err.errno == 1:
# permission problem, should be the chmod(0600) issue
'for specified oscrc: %s' % oscrc)
raise # else
- except urllib.error.URLError:
- raise ObsError("invalid service apiurl: %s" % apiurl)
else:
conf.get_config()
from gitbuildsys.errors import GbsError
-GBS = SourceFileLoader("gbs", "./tools/gbs").load_module().main
+GBS = SourceFileLoader("gbs", "./tools/gbs").load_module("gbs").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("gbs").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("gbs").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("gbs").main
def with_data(fname):
"""