From c0e42783c29154cdd46423fea3e611acd69bde7c Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Fri, 24 Mar 2023 06:52:22 +0000 Subject: automatic import of copr-backend --- copr_messaging.patch | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 copr_messaging.patch (limited to 'copr_messaging.patch') diff --git a/copr_messaging.patch b/copr_messaging.patch new file mode 100644 index 0000000..652ac52 --- /dev/null +++ b/copr_messaging.patch @@ -0,0 +1,28 @@ +diff --git a/backend/copr_backend/msgbus.py b/backend/copr_backend/msgbus.py +index 0c224ef1..d5352041 100644 +--- a/backend/copr_backend/msgbus.py ++++ b/backend/copr_backend/msgbus.py +@@ -7,7 +7,13 @@ import logging + import copy + import json + +-from copr_messaging import schema ++try: ++ from copr_messaging import schema ++except ImportError: ++ # fedmsg is optional ++ copr_messaging_enabled = False ++else: ++ copr_messaging_enabled = True + + from .constants import BuildStatus + +@@ -33,6 +39,8 @@ def message_from_worker_job(style, topic, job, who, ip, pid): + once we can exepect that people are using copr-messaging module (and thus + we can change message format without affecting the API). + """ ++ if not copr_messaging_enabled: ++ return None + if style == 'v1': + content = { + 'user': job.submitter, -- cgit v1.2.3