mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-02 02:11:19 +08:00
Move CoprClient imports inside the functions where they are referenced.
This commit is contained in:
@@ -53,11 +53,6 @@ import module_build_service.utils
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
|
||||
try:
|
||||
from copr.client import CoprClient
|
||||
except ImportError:
|
||||
log.exception("Failed to import CoprClient.")
|
||||
|
||||
# TODO: read defaults from module_build_service's config
|
||||
KOJI_DEFAULT_GROUPS = {
|
||||
'build': [
|
||||
@@ -814,6 +809,8 @@ class CoprModuleBuilder(GenericBuilder):
|
||||
m1 = db.session.query(ModuleBuild).first()
|
||||
m1.mmd().dump(modulemd)
|
||||
|
||||
from copr.client import CoprClient
|
||||
|
||||
# @TODO how the authentication is designed?
|
||||
username, copr = "@copr", "modules"
|
||||
client = CoprClient.create_from_file_config()
|
||||
|
||||
@@ -31,11 +31,6 @@ from pdc_client import PDCClient
|
||||
import logging
|
||||
log = logging.getLogger()
|
||||
|
||||
try:
|
||||
from copr.client import CoprClient
|
||||
except ImportError:
|
||||
log.exception("Failed to import CoprClient.")
|
||||
|
||||
import six
|
||||
import module_build_service
|
||||
|
||||
@@ -180,6 +175,10 @@ def get_module_repo(session, module_info, strict=False, config=module_build_serv
|
||||
if module["koji_tag"] != "-":
|
||||
raise NotImplementedError
|
||||
|
||||
# TODO We should revisit the decision to include CoprClient code in the
|
||||
# pdc.py module.
|
||||
from copr.client import CoprClient
|
||||
|
||||
# Module was built in Copr
|
||||
# @TODO get the correct user
|
||||
owner, nvr = "@copr", module["variant_id"]
|
||||
|
||||
Reference in New Issue
Block a user