|
@@ -48,13 +48,12 @@ def check_vm_resource(app_name):
|
|
|
myLogger.info_logger("Check complete: The number of CPU cores is insufficient!")
|
|
|
return False
|
|
|
need_mem_total = int(requirements_var['memory'])
|
|
|
- mem_total = float(
|
|
|
- shell_execute.execute_command_output_all("free -m | grep Mem | awk \'{print $2}\'")["result"]) / 1024
|
|
|
+ mem = shell_execute.execute_command_output_all("free -m | grep Mem")["result"].split()
|
|
|
+ mem_total = float(mem[1]) / 1024
|
|
|
if mem_total < need_mem_total:
|
|
|
myLogger.info_logger("Check complete: The total amount of memory is insufficient!")
|
|
|
return False
|
|
|
- mem_free = float(
|
|
|
- shell_execute.execute_command_output_all("free -m | grep Mem | awk \'{print $4}\'")["result"]) / 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
|