From 5a469e72876b5d63994327278c8fcdda82ee6505 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Oct 29 2018 13:37:01 +0000 Subject: Move down the import to solve a circular import issue Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/lib/lib_ci.py b/pagure/lib/lib_ci.py index c8b9d39..76e8fed 100644 --- a/pagure/lib/lib_ci.py +++ b/pagure/lib/lib_ci.py @@ -18,9 +18,6 @@ import time import pagure.exceptions import pagure.lib.query -# This import is needed as pagure.lib relies on Project.ci_hook to be -# defined and accessible and this happens in pagure.hooks.pagure_ci -from pagure.hooks import pagure_ci # noqa: E402,F401 from pagure.config import config as pagure_config _log = logging.getLogger(__name__) @@ -39,6 +36,10 @@ def process_jenkins_build(session, project, build_id, iteration=0): """ import jenkins + # This import is needed as pagure.lib relies on Project.ci_hook to be + # defined and accessible and this happens in pagure.hooks.pagure_ci + from pagure.hooks import pagure_ci # noqa: E402,F401 + # Jenkins Base URL _log.info("Querying jenkins at: %s", project.ci_hook.ci_url) jenk = jenkins.Jenkins(project.ci_hook.ci_url)