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
|
from django.utils import timezone
|
||||||
|
|
||||||
|
|
||||||
def makewificonfig(device):
|
def makewificonfig(device):
|
||||||
output = ""
|
output = ""
|
||||||
i = 1
|
i = 1
|
||||||
|
@ -18,6 +19,7 @@ def makewificonfig(device):
|
||||||
|
|
||||||
return output
|
return output
|
||||||
|
|
||||||
|
|
||||||
def heartbeathandler(device, ip):
|
def heartbeathandler(device, ip):
|
||||||
if device.update:
|
if device.update:
|
||||||
sigRebootDevice(device.serial, None, False)
|
sigRebootDevice(device.serial, None, False)
|
||||||
|
@ -27,9 +29,12 @@ if /usr/bin/wget -O/tmp/update.bin https://${HOSTNAME:-admin360.kumi.host}/updat
|
||||||
then
|
then
|
||||||
/sbin/sysupgrade -F -n /tmp/update.bin
|
/sbin/sysupgrade -F -n /tmp/update.bin
|
||||||
fi
|
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 = """
|
code = """
|
||||||
. /etc/vpnsecret
|
. /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;
|
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
|
/sbin/uci commit /etc/config/wireless
|
||||||
/bin/rm /tmp/wireless.*
|
/bin/rm /tmp/wireless.*
|
||||||
fi
|
fi
|
||||||
"""
|
""" # noqa
|
||||||
device.lastbeat = timezone.now()
|
device.lastbeat = timezone.now()
|
||||||
|
|
||||||
elif device.reboot:
|
elif device.reboot:
|
||||||
|
@ -58,7 +63,7 @@ fi
|
||||||
code = """
|
code = """
|
||||||
. /etc/vpnsecret
|
. /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
|
/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()
|
device.lastbeat = timezone.now()
|
||||||
if ip:
|
if ip:
|
||||||
|
|
Loading…
Reference in a new issue