diff --git a/src/target.py b/src/target.py index 09c9183..a2b9b15 100644 --- a/src/target.py +++ b/src/target.py @@ -5,7 +5,7 @@ log = logging.getLogger(__name__) class Target: - def send_data(date, status, time, url, protocol, station): + def send_data(self, date, status, time, url, protocol, station): raise NotImplementedError() @@ -20,7 +20,7 @@ class Influx(Target): string = string.replace(c, "\\"+c) return string - def send_data(date, status, time, url, protocol, station=00): + def send_data(self, date, status, time, url, protocol, station=00): data = "response_time,url={url},status={status},protocol={protocol},station={station} value={time} {timestamp}".format( url=influx_escape(url), status=influx_escape(str(status)), @@ -29,11 +29,11 @@ class Influx(Target): protocol=self.escape(protocol), station=station ) - r=requests.post(INFLUX_URL, data=data) + r = requests.post(INFLUX_URL, data=data) log.info(str(r) + " " + str(r.text)) return r.ok TARGETS = { "Influx": Influx, -} \ No newline at end of file +}