Revert "Remove .kumilock files – the queue prevents synchronous executions"
This reverts commit d0307e13d7
.
This commit is contained in:
parent
aec67fe5b7
commit
ecafcf7aa7
1 changed files with 8 additions and 0 deletions
|
@ -21,6 +21,12 @@ def mkfirmware(device, path):
|
|||
DEVICEDIR = "/opt/vpnmanager/device-config/%i/" % device.model.id
|
||||
SRCDIR = "/opt/vpnmanager/imagebuilder/%i/" % device.model.id
|
||||
|
||||
if glob.glob(SRCDIR + "/.kumilock"):
|
||||
return False
|
||||
|
||||
with open(SRCDIR + "/.kumilock", "w") as lock:
|
||||
lock.write("")
|
||||
|
||||
tempdir = tempfile.TemporaryDirectory()
|
||||
|
||||
copy_tree(DEVICEDIR, tempdir.name)
|
||||
|
@ -70,12 +76,14 @@ def mkfirmware(device, path):
|
|||
try:
|
||||
subprocess.call(["/usr/bin/make"])
|
||||
except:
|
||||
os.remove(SRCDIR + "/.kumilock")
|
||||
os.chdir(BEFORE)
|
||||
return False
|
||||
|
||||
os.chdir(BEFORE)
|
||||
|
||||
os.rename(glob.glob(SRCDIR + "/bin/targets/ar71xx/generic/*squashfs-sysupgrade.bin")[0], "%s/%s.bin" % (path, device.id))
|
||||
os.remove(SRCDIR + "/.kumilock")
|
||||
os.system("rm -rf " + SRCDIR + "/files/")
|
||||
os.system("rm " + SRCDIR + "/bin/targets/ar71xx/generic/*")
|
||||
device.firmware = datetime.datetime.now()
|
||||
|
|
Loading…
Reference in a new issue