Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
蜕变的菜鸟
glances
提交
4877be45
G
glances
项目概览
蜕变的菜鸟
/
glances
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
glances
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4877be45
编写于
10月 26, 2016
作者:
N
nicolargo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Deprecated platform method in Python 3.7 #945
上级
ae539dde
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
28 addition
and
10 deletion
+28
-10
NEWS
NEWS
+2
-1
glances/plugins/glances_system.py
glances/plugins/glances_system.py
+23
-7
requirements.txt
requirements.txt
+2
-1
setup.py
setup.py
+1
-1
未找到文件。
NEWS
浏览文件 @
4877be45
...
...
@@ -10,13 +10,14 @@ Enhancements and news features:
* Add ZeroMQ exporter (issue #939)
* Add CouchDB exporter (issue #928)
* Add hotspot Wifi informations (issue #937)
* Add default interface speed and automatic rate thresolds (issue #718)
* Add default interface speed and automatic rate thresolds (issue #718)
* Highlight max stats in the processes list (issue #878)
* Docker alerts and actions (issue #875)
* Glances API returns the processes PPID (issue #926)
* Configure server cached time from the command line --cached-time (issue #901)
* Make the log logger configurable (issue #900)
* System uptime in export (issue #890)
* Deprecated platform method in Python 3.7 (issue #945)
Bugs corrected:
...
...
glances/plugins/glances_system.py
浏览文件 @
4877be45
...
...
@@ -2,7 +2,7 @@
#
# This file is part of Glances.
#
# Copyright (C) 201
5
Nicolargo <nicolas@nicolargo.com>
# Copyright (C) 201
6
Nicolargo <nicolas@nicolargo.com>
#
# Glances is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
...
...
@@ -23,7 +23,14 @@ import os
import
platform
import
re
from
io
import
open
try
:
import
distro
except
ImportError
:
distro_tag
=
False
else
:
distro_tag
=
True
from
glances.logger
import
logger
from
glances.compat
import
iteritems
from
glances.plugins.glances_plugin
import
GlancesPlugin
...
...
@@ -38,7 +45,8 @@ snmp_oid = {'default': {'hostname': '1.3.6.1.2.1.1.5.0',
# Dict (key: OS short name) of dict (reg exp OID to human)
# Windows:
# http://msdn.microsoft.com/en-us/library/windows/desktop/ms724832%28v=vs.85%29.aspx
snmp_to_human
=
{
'windows'
:
{
'Windows Version 6.3'
:
'Windows 8.1 or Server 2012R2'
,
snmp_to_human
=
{
'windows'
:
{
'Windows Version 10.0'
:
'Windows 10 or Server 2016'
,
'Windows Version 6.3'
:
'Windows 8.1 or Server 2012R2'
,
'Windows Version 6.2'
:
'Windows 8 or Server 2012'
,
'Windows Version 6.1'
:
'Windows 7 or Server 2008R2'
,
'Windows Version 6.0'
:
'Windows Vista or Server 2008'
,
...
...
@@ -112,11 +120,19 @@ class Plugin(GlancesPlugin):
self
.
stats
[
'hostname'
]
=
platform
.
node
()
self
.
stats
[
'platform'
]
=
platform
.
architecture
()[
0
]
if
self
.
stats
[
'os_name'
]
==
"Linux"
:
linux_distro
=
platform
.
linux_distribution
()
if
linux_distro
[
0
]
==
''
:
self
.
stats
[
'linux_distro'
]
=
_linux_os_release
()
else
:
if
distro_tag
:
# Use the distro external lib
# Why ?
# Because platform.linux_distribution is predicated in Python 3.7
linux_distro
=
distro
.
linux_distribution
()
self
.
stats
[
'linux_distro'
]
=
' '
.
join
(
linux_distro
[:
2
])
else
:
try
:
# For Python < 3.7
linux_distro
=
platform
.
linux_distribution
()
self
.
stats
[
'linux_distro'
]
=
' '
.
join
(
linux_distro
[:
2
])
except
AttributeError
:
self
.
stats
[
'linux_distro'
]
=
_linux_os_release
()
self
.
stats
[
'os_version'
]
=
platform
.
release
()
elif
self
.
stats
[
'os_name'
].
endswith
(
'BSD'
):
self
.
stats
[
'os_version'
]
=
platform
.
release
()
...
...
requirements.txt
浏览文件 @
4877be45
psutil
==4.3.0
psutil
==4.4.0
distro
==1.0.0
setup.py
浏览文件 @
4877be45
...
...
@@ -33,7 +33,7 @@ def get_data_files():
def
get_requires
():
requires
=
[
'psutil>=2.0.0'
]
requires
=
[
'psutil>=2.0.0'
,
'distro>=1.0.0'
]
return
requires
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录