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