From 60e58ea9f07d04b0a719c9210dc2ba3f8b4a515c Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Sun, 21 Apr 2019 08:06:53 +0000 Subject: [PATCH] Make code less readable, but that's what pycodestyle wants... --- manager/device.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/manager/device.py b/manager/device.py index 87a06e6..4ada0ac 100644 --- a/manager/device.py +++ b/manager/device.py @@ -2,6 +2,7 @@ from .signals import * from django.utils import timezone + def makewificonfig(device): output = "" i = 1 @@ -18,6 +19,7 @@ def makewificonfig(device): return output + def heartbeathandler(device, ip): if device.update: sigRebootDevice(device.serial, None, False) @@ -27,9 +29,12 @@ if /usr/bin/wget -O/tmp/update.bin https://${HOSTNAME:-admin360.kumi.host}/updat then /sbin/sysupgrade -F -n /tmp/update.bin fi -""" +""" # noqa + + elif device.model.wwan and ( + (not device.wireless) or device.wireless < device.changed + ): - elif device.model.wwan and ((not device.wireless) or device.wireless < device.changed): code = """ . /etc/vpnsecret if /usr/bin/wget -O/tmp/wireless.in https://${HOSTNAME:-admin360.kumi.host}/wireless --post-data "secret=$SECRET" --no-check-certificate 2>/var/log/wget; @@ -48,7 +53,7 @@ if /usr/bin/wget -O/tmp/wireless.in https://${HOSTNAME:-admin360.kumi.host}/wire /sbin/uci commit /etc/config/wireless /bin/rm /tmp/wireless.* fi -""" +""" # noqa device.lastbeat = timezone.now() elif device.reboot: @@ -58,7 +63,7 @@ fi code = """ . /etc/vpnsecret /usr/bin/wget -O/etc/hosts https://${HOSTNAME:-admin360.kumi.host}/hosts --post-data "secret=$SECRET" --no-check-certificate >/var/log/wget 2>&1 -""" +""" # noqa device.lastbeat = timezone.now() if ip: