From 55346cd18d8305750ebeca49f71a8dff0b2f9b87 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Sun, 11 Sep 2016 10:59:14 +0200 Subject: [PATCH] AMP plugin crashs on start with Python 3 (issue #917) --- glances/amps/glances_systemv.py | 2 +- glances/amps_list.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/glances/amps/glances_systemv.py b/glances/amps/glances_systemv.py index e46eded9..53e8cc48 100644 --- a/glances/amps/glances_systemv.py +++ b/glances/amps/glances_systemv.py @@ -69,7 +69,7 @@ class Amp(GlancesAmp): # Get the systemctl status logger.debug('{}: Update stats using service {}'.format(self.NAME, self.get('service_cmd'))) try: - res = check_output(self.get('service_cmd').split(), stderr=STDOUT) + res = check_output(self.get('service_cmd').split(), stderr=STDOUT).decode('utf-8') except OSError as e: logger.debug('{}: Error while executing service ({})'.format(self.NAME, e)) else: diff --git a/glances/amps_list.py b/glances/amps_list.py index eab3b0d6..c9020717 100644 --- a/glances/amps_list.py +++ b/glances/amps_list.py @@ -122,7 +122,7 @@ class AmpsList(object): else: # Set the process number to 0 v.set_count(0) - if v.count_min() > 0: + if v.count_min() is not None and v.count_min() > 0: # Only display the "No running process message" is countmin is defined v.set_result("No running process")