Private GIT

Skip to content
Snippets Groups Projects
Commit 829905d2 authored by Josh Smith's avatar Josh Smith
Browse files

fixed typos, errors with packetloss data

parent 61e60fb1
Branches
No related tags found
No related merge requests found
FROM python:3.8-slim-buster
LABEL maintainer="Aiden Gilmartin" \
description="Speedtest to InfluxDB data bridge"
LABEL maintainer="Josh Smith" \
description="Original by Aiden Gilmartin. Speedtest to InfluxDB data bridge"
#wget "https://ookla.bintray.com/download/$(wget https://ookla.bintray.com/download/ -q -O - | grep x86_64-linux.tgz\" | grep -Po "(?<=href=\")[^^\"]*" | cut -d ":" -f 2)"
# Install dependencies
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
......
......@@ -2,7 +2,6 @@ import time
import json
import subprocess
import os
from influxdb import InfluxDBClient
# InfluxDB Settings
......@@ -29,7 +28,7 @@ def init_db():
else:
influxdb_client.switch_database(DB_DATABASE) # Switch to if does exist.
def pkt_loss(data):
if data['packetLoss']:
if 'packetLoss' in data.keys():
return data['packetLoss']
else:
return 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment