| |
@@ -22,16 +22,22 @@
|
| |
|
| |
import pkg_resources
|
| |
|
| |
- from fedora_messaging.api import Message, publish
|
| |
- from fedora_messaging.exceptions import PublishReturned, ConnectionException
|
| |
-
|
| |
- from resultsdb import db
|
| |
+ from resultsdb import db, app
|
| |
from resultsdb.models.results import Result, ResultData
|
| |
from resultsdb.serializers.api_v2 import Serializer
|
| |
|
| |
import logging
|
| |
log = logging.getLogger(__name__)
|
| |
|
| |
+ try:
|
| |
+ from fedora_messaging.api import Message, publish
|
| |
+ from fedora_messaging.exceptions import PublishReturned, ConnectionException
|
| |
+ except ImportError:
|
| |
+ if app.config.get('MESSAGE_BUS_PUBLISH_TASKOTRON') or app.config.get('MESSAGE_BUS_PLUGIN'):
|
| |
+ log.error('fedora-messaging must be installed if "MESSAGE_BUS_PUBLISH_TASKOTRON" is '
|
| |
+ 'enabled or "MESSAGE_BUS_PLUGIN" is set to "fedmsg"')
|
| |
+ raise
|
| |
+
|
| |
|
| |
SERIALIZE = Serializer().serialize
|
| |
|
| |
Since fedora-messaging is not packaged in EPEL7, RHEL 7 deployments outside of Fedora Infra can't upgrade to v2.2.0. This will allow
for a deployment that uses alternate messaging plugins such as stomp.