From ea2bc36a727fb858c5448c6a3ee51bc5531a57c8 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Mon, 3 Apr 2017 22:16:41 -0400 Subject: [PATCH] Fix flake8 again --- mqtt_statsd/daemon.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mqtt_statsd/daemon.py b/mqtt_statsd/daemon.py index 5e4309e..f44a13f 100644 --- a/mqtt_statsd/daemon.py +++ b/mqtt_statsd/daemon.py @@ -49,12 +49,10 @@ class MQTTStat(threading.Thread): self.client.username_pw_set(auth['username'], password=auth.get('password')) - def run(self): def on_connect(client, userdata, flags, rc): client.subscribe(self.mqtt_topic) - def on_message(client, userdata, msg): if self.statsd_type == 'gauge': self.statsd_client.gauge(self.statsd_topic, msg.payload) @@ -62,6 +60,7 @@ class MQTTStat(threading.Thread): self.statsd_client.timer(self.statsd_topic, msg.payload) elif self.statsd_type == 'counter': self.statsd_client.incr(self.statsd_topic) + self.client.on_connect = on_connect self.client.on_message = on_message self.client.connect(self.hostname, self.port)