mirror of https://github.com/openspug/spug
U 改进获取主机扩展信息兼容性
parent
69d5bf74e5
commit
64d24b64ac
|
@ -197,7 +197,7 @@ def fetch_host_extend(ssh):
|
||||||
if '/etc/os-release' in out:
|
if '/etc/os-release' in out:
|
||||||
code, out = ssh.exec_command_raw("cat /etc/issue | head -1 | awk '{print $1,$2,$3}'")
|
code, out = ssh.exec_command_raw("cat /etc/issue | head -1 | awk '{print $1,$2,$3}'")
|
||||||
if code == 0:
|
if code == 0:
|
||||||
response['os_name'] = out.strip()
|
response['os_name'] = out.strip()[:50]
|
||||||
|
|
||||||
code, out = ssh.exec_command_raw('hostname -I')
|
code, out = ssh.exec_command_raw('hostname -I')
|
||||||
if code == 0:
|
if code == 0:
|
||||||
|
|
Loading…
Reference in New Issue