mirror of
https://github.com/Websoft9/websoft9.git
synced 2025-01-24 10:17:15 +08:00
update docker.py
This commit is contained in:
parent
2e76015c5c
commit
618f5d2830
@ -53,12 +53,13 @@ def check_vm_resource(app_name):
|
||||
if mem_total < need_mem_total:
|
||||
myLogger.info_logger("Check complete: The total amount of memory is insufficient!")
|
||||
return False
|
||||
mem_free = float(mem[3]) /1024
|
||||
mem_free = float(mem[3]) / 1024
|
||||
if need_mem_total > 4 and mem_free < 4:
|
||||
myLogger.info_logger("Check complete: There is not enough memory left!")
|
||||
return False
|
||||
need_disk = int(requirements_var['disk'])
|
||||
disk_free = float(shell_execute.execute_command_output_all("df -m | awk \'$NF==\"/\"{print $4}\'")["result"]) / 1024
|
||||
disk_free = float(
|
||||
shell_execute.execute_command_output_all("df -m --output=avail /")["result"].split("\n")[1]) / 1024
|
||||
if disk_free < need_disk:
|
||||
myLogger.info_logger("Check complete: There are not enough disks left!")
|
||||
return False
|
||||
|
Loading…
Reference in New Issue
Block a user