Make code less readable, but that's what pycodestyle wants...

This commit is contained in:
Kumi 2019-04-21 08:06:53 +00:00
parent c827006457
commit 60e58ea9f0

View file

@ -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: