提交 930d5174 编写于 作者: N nicolargo

crash on startup on Illumos when no swap is configured #1767

上级 bf681f67
......@@ -81,7 +81,11 @@ class Plugin(GlancesPlugin):
stats['percpu'] = cpu_percent.get(percpu=True)
# Use the psutil lib for the memory (virtual and swap)
stats['mem'] = psutil.virtual_memory().percent
stats['swap'] = psutil.swap_memory().percent
try:
stats['swap'] = psutil.swap_memory().percent
except RuntimeError:
# Correct issue in Illumos OS (see #1767)
stats['swap'] = None
elif self.input_method == 'snmp':
# Not available
pass
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册