try:
(name, key) = opt.split('.')
except ValueError:
- raise Exception("Invalid repo option: %s" % opt)
+ raise errors.ConfigError("invalid repo option: %s" % opt)
else:
if key not in ('url', 'user', 'passwdx'):
- raise Exception("Invalid repo option: %s" % opt)
+ raise errors.ConfigError("invalid repo option: %s" % opt)
repos.add(name)
# get repo settings form build section
# if any parsing errors occurred, raise an exception
if exc:
- raise exc
+ raise errors.ConfigError(str(exc))
def set(self, section, option, value, replace_opt=None):
"""When set new value, need to update the readin file lines,
# if reach here, sec is the last one
return -1
- SafeConfigParser.set(self, section, option, value)
+ try:
+ SafeConfigParser.set(self, section, option, value)
+ except NoSectionError, err:
+ raise errors.ConfigError(str(err))
# If the code reach here, it means the section and key are ok
if replace_opt is None:
from gitbuildsys.__version__ import VERSION
from gitbuildsys import msger, cmdln, errors
-from gitbuildsys.conf import configmgr
def handle_repository(option, opt_str, value, parser):
if not value:
if __name__ == '__main__':
try:
+ from gitbuildsys.conf import configmgr
sys.exit(Gbs().main())
except KeyboardInterrupt: