mirror of https://github.com/openspug/spug
U 改进获取主机扩展信息兼容性
parent
64987edf50
commit
8574217191
|
@ -189,7 +189,7 @@ def fetch_host_extend(ssh):
|
||||||
with ssh:
|
with ssh:
|
||||||
code, out = ssh.exec_command_raw('nproc')
|
code, out = ssh.exec_command_raw('nproc')
|
||||||
if code != 0:
|
if code != 0:
|
||||||
code, out = ssh.exec_command_raw("grep -c 'model name' /proc/cpuinfo")
|
code, out = ssh.exec_command_raw("grep -c '^processor' /proc/cpuinfo")
|
||||||
if code == 0:
|
if code == 0:
|
||||||
response['cpu'] = int(out.strip())
|
response['cpu'] = int(out.strip())
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue