mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-05 11:48:33 +08:00
create koji sessions on behalf of users
This commit is contained in:
@@ -261,7 +261,7 @@ class KojiModuleBuilder(GenericBuilder):
|
||||
log.debug("Using koji profile %r" % config.koji_profile)
|
||||
log.debug("Using koji_config: %s" % config.koji_config)
|
||||
|
||||
self.koji_session = self.get_session(config)
|
||||
self.koji_session = self.get_session(config, owner)
|
||||
self.arches = config.koji_arches
|
||||
if not self.arches:
|
||||
raise ValueError("No koji_arches specified in the config.")
|
||||
@@ -364,7 +364,7 @@ chmod 644 %buildroot/%_rpmconfigdir/macros.d/macros.modules
|
||||
return srpm_paths[0]
|
||||
|
||||
@staticmethod
|
||||
def get_session(config):
|
||||
def get_session(config, owner):
|
||||
koji_config = munch.Munch(koji.read_config(
|
||||
profile_name=config.koji_profile,
|
||||
user_config=config.koji_config,
|
||||
@@ -384,7 +384,7 @@ chmod 644 %buildroot/%_rpmconfigdir/macros.d/macros.modules
|
||||
principal=principal,
|
||||
keytab=keytab,
|
||||
ccache=ccache,
|
||||
proxyuser=None,
|
||||
proxyuser=owner,
|
||||
)
|
||||
else:
|
||||
koji_session.krb_login(ccache=ccache)
|
||||
@@ -393,7 +393,7 @@ chmod 644 %buildroot/%_rpmconfigdir/macros.d/macros.modules
|
||||
os.path.expanduser(koji_config.cert),
|
||||
None,
|
||||
os.path.expanduser(koji_config.serverca),
|
||||
proxyuser=None,
|
||||
proxyuser=owner,
|
||||
)
|
||||
else:
|
||||
raise ValueError("Unrecognized koji authtype %r" % authtype)
|
||||
|
||||
@@ -185,7 +185,9 @@ class Poller(threading.Thread):
|
||||
# TODO re-use
|
||||
|
||||
if conf.system == "koji":
|
||||
koji_session = rida.builder.KojiModuleBuilder.get_session(conf)
|
||||
# we don't do this on behalf of users
|
||||
koji_session = (
|
||||
rida.builder.KojiModuleBuilder.get_session(conf, None))
|
||||
log.info("Querying tasks for statuses:")
|
||||
res = models.ComponentBuild.query.filter_by(state=koji.BUILD_STATES['BUILDING']).all()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user