From 0e9869a95780017c5e61bca27f6b6ea7090fddfe Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Sep 14 2017 13:22:01 +0000 Subject: Use koji.grab_session_options() rather than opencoding it create_koji_session_opts() is doing the same as koji.grab_session_options() (introduced with koji 1.11), but fails to handle the 'serverca' and 'no_ssl_verify' options, potentially causing SSL verification failure if one tries to use them. koji.grab_session_options() does not have this problem, and this allows us to kill a bit of code. Signed-off-by: Christophe Fergeau --- diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py index 259959b..6654da1 100644 --- a/pyrpkg/__init__.py +++ b/pyrpkg/__init__.py @@ -305,30 +305,6 @@ class Commands(object): return defaults - def create_koji_session_opts(self, koji_config): - """Create session options from Koji config""" - - opt_names = ( - 'anon_retry', - 'debug', - 'debug_xmlrpc', - 'keepalive', - 'krbservice', - 'max_retries', - 'offline_retry', - 'offline_retry_interval', - 'retry_interval', - 'timeout', - 'use_fast_upload', - 'krb_rdns', - ) - - session_opts = {} - for name in opt_names: - if name in koji_config and koji_config[name] is not None: - session_opts[name] = koji_config[name] - return session_opts - def login_koji_session(self, koji_config, session): """Login Koji session""" @@ -388,7 +364,7 @@ class Commands(object): os.path.basename(self.build_client), koji_config['server']) # Build session options used to create instance of ClientSession - session_opts = self.create_koji_session_opts(koji_config) + session_opts = koji.grab_session_options(koji_config) try: session = koji.ClientSession(koji_config['server'], session_opts)