Commit caf4fd5e authored by jssuzanne's avatar jssuzanne
Browse files

Added deactivated_profiledecorator

branch : 8.0
parent 5ac90b816af3
......@@ -2,3 +2,25 @@
import profile
import message
import ping
import os
from logging import getLogger
from import config
logger = getLogger(__name__)
def wrap_deactivated_profile(*a, **kw):
# TODO miss method name
logger.warning('Call to a deactivated method')
def deactivated_profile(func):
if os.environ.get('ANYBUS_PUBLISH', False) == 'deactivated':
return wrap_deactivated_profile
profile = config.get('anybus_profile')
if profile == 'deactivated':
return wrap_deactivated_profile
return func
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