mirror of
https://github.com/ansible/awx.git
synced 2026-02-20 20:50:06 -03:30
Merge pull request #753 from ansible/jag/fix-nostatsclient
Fix to NoStatsClient in callback plugin
This commit is contained in:
@@ -56,12 +56,13 @@ if os.environ.get('GRAPHITE_PORT_8125_UDP_ADDR'):
|
|||||||
prefix='tower.job.event_callback',
|
prefix='tower.job.event_callback',
|
||||||
maxudpsize=512)
|
maxudpsize=512)
|
||||||
else:
|
else:
|
||||||
class NoStatsClient(object):
|
from statsd import StatsClientBase
|
||||||
def __getattr__(self, item):
|
class NoStatsClient(StatsClientBase):
|
||||||
if item.startswith('__'):
|
def __init__(self, *args, **kwargs):
|
||||||
return super(NoStatsClient, self).__getattr__(item)
|
pass
|
||||||
else:
|
|
||||||
return lambda *args, **kwargs: None
|
def _send(self, *args, **kwargs):
|
||||||
|
pass
|
||||||
statsd = NoStatsClient()
|
statsd = NoStatsClient()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user