From 67a4503795639a28b832bf499e7bafa889ee8809 Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Mar 13 2017 21:18:52 +0000 Subject: honor the stg namespace in koji configs Signed-off-by: Adam Miller --- diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py index 7ded7f1..ed683c6 100644 --- a/pyrpkg/__init__.py +++ b/pyrpkg/__init__.py @@ -260,6 +260,12 @@ class Commands(object): build_client_name = os.path.basename(self.build_client) + # Handle stage namespacing for koji configs + if "stage" in os.path.basename(sys.argv[0]): + koji_conf_section = 'stg' + else: + koji_conf_section = build_client_name + config_val_methods = { 'anon_retry': config.getboolean, 'debug': config.getboolean, @@ -274,12 +280,12 @@ class Commands(object): 'krb_rdns': config.getboolean, } - if config.has_section(build_client_name): - for name, value in config.items(build_client_name): + if config.has_section(koji_conf_section): + for name, value in config.items(koji_conf_section): if name not in defaults: continue get_method = config_val_methods.get(name) - defaults[name] = get_method(build_client_name, name) if get_method else value + defaults[name] = get_method(koji_conf_section, name) if get_method else value if not defaults['server']: raise rpkgError('No server defined in: %s' % ', '.join(confs))