summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJake Omann <jomann@nagios.com>2020-11-13 14:52:30 -0600
committerGitHub <noreply@github.com>2020-11-13 21:52:30 +0100
commitfd69f22ee5ca38ceff32ae3fac15420c5d8fce29 (patch)
tree72ca5fb2e29ee2a04ff7a16a8e060f5528588b6d
parent7050e73c48b38caf2f19409167ba8dfaa9ab9fd4 (diff)
downloadpsutil-fd69f22ee5ca38ceff32ae3fac15420c5d8fce29.tar.gz
Fix solaris swap output when 'encrypted' column exists (#1876)
-rw-r--r--CREDITS3
-rw-r--r--HISTORY.rst1
-rw-r--r--psutil/_pssunos.py2
3 files changed, 4 insertions, 2 deletions
diff --git a/CREDITS b/CREDITS
index ea13b16c..168f05d4 100644
--- a/CREDITS
+++ b/CREDITS
@@ -467,7 +467,8 @@ N: Farhan Khan
I: 823
N: Jake Omann
-I: 816, 775
+W: https://github.com/jomann09
+I: 816, 775, 1874
N: Jeremy Humble
W: https://github.com/jhumble
diff --git a/HISTORY.rst b/HISTORY.rst
index 8512793b..bcbffa69 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -15,6 +15,7 @@ XXXX-XX-XX
- 1866_: [Windows] process exe(), cmdline(), environ() may raise "invalid
access to memory location" on Python 3.9.
+- 1874_: [Solaris] wrong swap output given when encrypted column is present
5.7.3
=====
diff --git a/psutil/_pssunos.py b/psutil/_pssunos.py
index c64ea9ca..2af15dfa 100644
--- a/psutil/_pssunos.py
+++ b/psutil/_pssunos.py
@@ -155,7 +155,7 @@ def swap_memory():
total = free = 0
for line in lines:
line = line.split()
- t, f = line[-2:]
+ t, f = line[3:4]
total += int(int(t) * 512)
free += int(int(f) * 512)
used = total - free