Make code less readable, but that's what pycodestyle wants...
This commit is contained in:
parent
c827006457
commit
60e58ea9f0
1 changed files with 9 additions and 4 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue