From 37797bfd7f1c6c2e6e43200afa70d00112e79c20 Mon Sep 17 00:00:00 2001 From: Paco Hope Date: Sun, 8 Oct 2023 14:02:36 -0400 Subject: [PATCH] fixed ramswap --- src/hetrixtools_freebsd/cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hetrixtools_freebsd/cli.py b/src/hetrixtools_freebsd/cli.py index 26d8cf3..48335a2 100644 --- a/src/hetrixtools_freebsd/cli.py +++ b/src/hetrixtools_freebsd/cli.py @@ -137,7 +137,8 @@ class Update: """ # get last line, split it on spaces # Total 2097152 259452 1837700 12% - swapinfo = self.callCommand(['/usr/sbin/swapinfo']).splitlines()[-1:].split(" ") + swaptext = self.callCommand(['/usr/sbin/swapinfo']).splitlines()[-1:] + swapinfo = re.split( " +", swaptext[0] ) self.ramswap = str(int(swapinfo[2]) / int(swapinfo[1])) # these don't seem to exist on FreeBSD in the same way self.rambuff = str(0)