This commit is contained in:
parent
bae393196c
commit
3caeda1461
|
@ -39,11 +39,11 @@ def get_platform_info():
|
||||||
|
|
||||||
#硬盘使用
|
#硬盘使用
|
||||||
out = get_execute_out('df -h')
|
out = get_execute_out('df -h')
|
||||||
m = re.match(r'\/dev\/vda1\s+?(.+?)G\s+(.+?)G\s+(.+?)G', out)
|
m = re.findall(r'\/dev\/vda1\s+(.+?)G\s+(.+?)G\s+(.+?)G', out)
|
||||||
if m:
|
if len(m)>0:
|
||||||
info['disk_total'] = m.group(1)
|
info['disk_total'] = m[0][0]
|
||||||
info['disk_used'] = m.group(2)
|
info['disk_used'] = m[0][1]
|
||||||
info['disk_freed'] = m.group(3)
|
info['disk_freed'] = m[0][2]
|
||||||
|
|
||||||
return info
|
return info
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue