mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-13 19:29:57 +08:00
Use rida.conf for specifying path to copr config
This commit is contained in:
@@ -17,6 +17,7 @@ class BaseConfiguration(object):
|
||||
KOJI_CONFIG = '/etc/module_build_service/koji.conf'
|
||||
KOJI_PROFILE = 'koji'
|
||||
KOJI_ARCHES = ['i686', 'armv7hl', 'x86_64']
|
||||
COPR_CONFIG = '/etc/rida/copr.conf'
|
||||
PDC_URL = 'http://modularity.fedorainfracloud.org:8080/rest_api/v1'
|
||||
PDC_INSECURE = True
|
||||
PDC_DEVELOP = True
|
||||
|
||||
@@ -29,6 +29,7 @@ import modulemd
|
||||
from pdc_client import PDCClient
|
||||
from copr.client import CoprClient
|
||||
import six
|
||||
import rida
|
||||
|
||||
|
||||
|
||||
@@ -154,12 +155,13 @@ def get_module_tag(session, module_info, strict=False):
|
||||
"""
|
||||
return get_module(session, module_info, strict=strict)['koji_tag']
|
||||
|
||||
def get_module_repo(session, module_info, strict=False):
|
||||
def get_module_repo(session, module_info, strict=False, config=rida.conf):
|
||||
"""
|
||||
:param session : PDCClient instance
|
||||
:param module_info: list of module_info dicts
|
||||
:param strict: Normally this function returns None if no module can be
|
||||
found. If strict=True, then a ValueError is raised.
|
||||
:param config: instance of rida.config.Config
|
||||
:return: URL to a DNF repository for the module
|
||||
"""
|
||||
module = get_module(session, module_info, strict=strict)
|
||||
@@ -174,7 +176,7 @@ def get_module_repo(session, module_info, strict=False):
|
||||
# Module was built in Copr
|
||||
# @TODO get the correct user
|
||||
owner, nvr = "@copr", module["variant_id"]
|
||||
cl = CoprClient.create_from_file_config('./copr.conf')
|
||||
cl = CoprClient.create_from_file_config(config.copr_config)
|
||||
response = cl.get_module_repo(owner, nvr).data
|
||||
|
||||
if response["output"] == "notok":
|
||||
|
||||
Reference in New Issue
Block a user