mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-11-04 22:36:54 +08:00
Use anonymous Koji session properly
MBS calls some read-only Koji APIs which does not require to log into a session. This patch makes it optional to choose whether to login a session and use anonymous session properly to call those read-only APIs. Signed-off-by: Chenxiong Qi <cqi@redhat.com>
This commit is contained in:
@@ -588,7 +588,8 @@ class SCMBuilder(BaseBuilder):
|
||||
if not self.koji_session:
|
||||
# If Koji is not configured on the system, then just return 0.0 for components
|
||||
try:
|
||||
self.koji_session = KojiModuleBuilder.get_session(self.config, self.owner)
|
||||
self.koji_session = KojiModuleBuilder.get_session(
|
||||
self.config, self.owner, login=False)
|
||||
# If the component has not been built before, then None is returned. Instead,
|
||||
# let's return 0.0 so the type is consistent
|
||||
return self.koji_session.getAverageBuildDuration(component.package) or 0.0
|
||||
|
||||
Reference in New Issue
Block a user