maxbyte9p / oelabox

Infrastructure in a box designed for Enterprise Linux development. Utilizes Vagrant and Ansible for virtual machine provisioning.
GNU General Public License v3.0
15 stars 2 forks source link

Investigate how Koji tracks client sessions for Oela Importer. #18

Open maxbyte9p opened 4 months ago

maxbyte9p commented 4 months ago
# I don't like how dirty this is. Could be made way easier and neater.
def create_koji_session(config_name: str) -> koji.ClientSession:
    koji_config = koji.read_config(config_name)
    koji_session_opts = koji.grab_session_options(koji_config)
    koji_session = koji.ClientSession(koji_config['server'], koji_session_opts)
    koji_session.gssapi_login()
    koji_session.exclusiveSession(force=True) # Without this Koji doesn't want to be nice if we ctrl-c

    return koji_session

Basically make it so we don't need to use exclusiveSession and can possibly handle connections correctly.