Commit 5eb128a4 authored by jssuzanne's avatar jssuzanne
Browse files

Added environ entry to deactivate publisher

branch : 8.0
parent 7a1ff8e4bf83
......@@ -4,6 +4,7 @@ from logging import getLogger
from .schema import MessageStatus, anybus_schema_validation, PingSchema
from import config
import pika
import os
logger = getLogger(__name__)
......@@ -48,6 +49,9 @@ class AnyBusProfile(models.Model):
return MessageStatus.ACK
def publish(self, exchange, routing_key, data, contenttype):
if os.environ.get('ANYBUS_PUBLISH', False) == 'deactivated':
profile = config.get('anybus_profile')
if not profile:
self.write({'error': 'No profile found in configuration'})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment