From 6bca4fc1745bdf46c00430060c0009132a549732 Mon Sep 17 00:00:00 2001
From: atoav <dh@atoav.com>
Date: Thu, 30 Apr 2020 17:02:41 +0200
Subject: [PATCH] Fix load parsing

---
 bbbmon/meetings.py | 8 ++++----
 pyproject.toml     | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/bbbmon/meetings.py b/bbbmon/meetings.py
index 8f7c740..5b642d3 100644
--- a/bbbmon/meetings.py
+++ b/bbbmon/meetings.py
@@ -231,15 +231,15 @@ def meetings_twolines(config: Config, watch: int, fancy: bool):
             if config.on_server:
                 # If on server get load
                 w = subprocess.run(["w | head -1"], shell=True, stdout=subprocess.PIPE)
-                w = w.stdout.decode('utf-8').split("load average:")
+                w = w.stdout.decode('utf-8').strip().split("load average:")
                 if len(w) != 2:
-                    w = 0.0
+                    w = 999.0
                 else:
-                    w = w[1].strip().split(" ")[0]
+                    w = w[1].strip().split(" ")[0].rstrip(",")
                     try:
                         w = float(w.replace(",", "."))
                     except:
-                        w =  0.0
+                        w =  666.0
                 lines = [
                     "{}    rec / ses    ppl    mod   vid   mic  ear  lod".format(endpoint.name[:3]),
                     "stats   {:>2} /  {:<2}    {:>3}    {:>3}   {:>3}   {:>3}  {:>3}  {:.1f}"\
diff --git a/pyproject.toml b/pyproject.toml
index 586bd5a..c23cef6 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
 [tool.poetry]
 name = "bbbmon"
-version = "0.1.21"
+version = "0.1.22"
 description = "A small CLI utility to monitor bbb usage"
 authors = ["David Huss <david.huss@hfbk-hamburg.de>"]
 maintainers = ["David Huss <david.huss@hfbk-hamburg.de>"]
-- 
GitLab