This patch is dmach's patch [1] refactored according to mikem's comments [2]. [1] https://lists.fedoraproject.org/pipermail/buildsys/2015-August/004857.html [2] https://lists.fedoraproject.org/pipermail/buildsys/2015-October/004900.html Signed-off-by: Tomas Mlcoch <tmlcoch@redhat.com>
74 lines
1.6 KiB
ReStructuredText
74 lines
1.6 KiB
ReStructuredText
=============
|
|
Koji Profiles
|
|
=============
|
|
This document describes how to work with koji profiles.
|
|
|
|
|
|
Command Line Interface
|
|
======================
|
|
Koji client allows connecting to multiple koji instances from CLI
|
|
by using profiles. The default profile is given by executable file name,
|
|
which is 'koji'.
|
|
|
|
To change koji profile, you can:
|
|
|
|
* run koji with --profile=$profile_name argument
|
|
* change executable file name by symlinking $profile_name -> koji
|
|
|
|
|
|
Configuration Files
|
|
===================
|
|
Configuration files are located in following locations:
|
|
|
|
* /etc/koji.conf
|
|
* /etc/koji.conf.d/\*.conf
|
|
* ~/.koji/config.d/\*.conf
|
|
* user-specified config
|
|
|
|
Koji reads them, looking for [$profile_name] sections.
|
|
|
|
|
|
Using Koji Profiles in Python
|
|
=============================
|
|
Instead of using koji module directly,
|
|
get profile specific module by calling::
|
|
|
|
>>> mod = koji.get_profile_module($profile_name)
|
|
|
|
This module is clone of koji module with additional
|
|
profile specific tweaks.
|
|
|
|
Profile configuration is available via::
|
|
|
|
>>> mod.config
|
|
|
|
|
|
Example
|
|
-------
|
|
|
|
Print configuration::
|
|
|
|
import koji
|
|
|
|
fedora_koji = koji.get_profile_module("koji")
|
|
ppc_koji = koji.get_profile_module("ppc-koji")
|
|
|
|
for i in (fedora_koji, ppc_koji):
|
|
print "PROFILE: %s" % i.config.profile
|
|
for key, value in sorted(i.config.__dict__.items()):
|
|
print " %s = %s" % (key, value)
|
|
print
|
|
|
|
|
|
Use ClientSession::
|
|
|
|
import koji
|
|
|
|
koji_module = koji.get_profile_module("koji")
|
|
client = koji_module.ClientSession(koji_module.config.server)
|
|
print client.listTags()
|
|
|
|
|
|
TODO
|
|
====
|
|
* consider using pyxdg for user config locations
|