strict per item in config_files

This commit is contained in:
Yuming Zhu 2019-10-09 19:06:01 +08:00 committed by Tomas Kopecek
parent 153ac4058d
commit b2b8d5f9cc
8 changed files with 141 additions and 86 deletions

View file

@ -269,7 +269,7 @@ def send_queued_msgs(cbtype, *args, **kws):
log = logging.getLogger('koji.plugin.protonmsg')
global CONFIG
if not CONFIG:
CONFIG = koji.read_config_files(CONFIG_FILE, strict=True)
CONFIG = koji.read_config_files([(CONFIG_FILE, True)])
urls = CONFIG.get('broker', 'urls').split()
test_mode = False
if CONFIG.has_option('broker', 'test_mode'):

View file

@ -32,7 +32,7 @@ def maven_import(cbtype, *args, **kws):
filepath = kws['filepath']
if not config:
config = koji.read_config_files(CONFIG_FILE, strict=True)
config = koji.read_config_files([(CONFIG_FILE, True)])
name_patterns = config.get('patterns', 'rpm_names').split()
for pattern in name_patterns:
if fnmatch.fnmatch(rpminfo['name'], pattern):

View file

@ -28,7 +28,7 @@ def saveFailedTree(buildrootID, full=False, **opts):
# read configuration only once
if config is None:
config = koji.read_config_files(CONFIG_FILE, strict=True)
config = koji.read_config_files([(CONFIG_FILE, True)])
allowed_methods = config.get('permissions', 'allowed_methods').split()
if len(allowed_methods) == 1 and allowed_methods[0] == '*':
allowed_methods = '*'