# Buggy code
def update(self, process_list):
    """Update the AMP"""
    # 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)
    except OSError as e:
        logger.debug("{}: Error while executing service ({})".format(self.NAME, e))
    else:
        status = {"running": 0, "stopped": 0, "upstart": 0}
        # For each line
        for r in res.split("\n"):
            # Split per space .*
            l = r.split()
            if len(l) < 4:
                continue
            if l[1] == "+":
                status["running"] += 1
            elif l[1] == "-":
                status["stopped"] += 1
            elif l[1] == "?":
                status["upstart"] += 1
        # Build the output (string) message
        output = "Services\n"
        for k, v in iteritems(status):
            output += "{}: {}\n".format(k, v)
        self.set_result(output, separator=" ")

    return self.result()


# Traceback (TypeError)
Traceback (most recent call last):
File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/nicolargo/Dropbox/dev/glances/glances/__main__.py", line 29, in <module>
glances.main()
File "/home/nicolargo/Dropbox/dev/glances/glances/__init__.py", line 127, in main
args=core.get_args())
File "/home/nicolargo/Dropbox/dev/glances/glances/standalone.py", line 68, in __init__
self.stats.update()
File "/home/nicolargo/Dropbox/dev/glances/glances/stats.py", line 154, in update
self._plugins[p].update()
File "/home/nicolargo/Dropbox/dev/glances/glances/plugins/glances_plugin.py", line 734, in wrapper
ret = fct(*args, **kw)
File "/home/nicolargo/Dropbox/dev/glances/glances/plugins/glances_amps.py", line 58, in update
for k, v in iteritems(self.glances_amps.update()):
File "/home/nicolargo/Dropbox/dev/glances/glances/amps_list.py", line 125, in update
if v.count_min() > 0:
TypeError: unorderable types: NoneType() > int()

# Fixed code
def update(self, process_list):
    """Update the AMP"""
    # 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).decode(
            "utf-8"
        )
    except OSError as e:
        logger.debug("{}: Error while executing service ({})".format(self.NAME, e))
    else:
        status = {"running": 0, "stopped": 0, "upstart": 0}
        # For each line
        for r in res.split("\n"):
            # Split per space .*
            l = r.split()
            if len(l) < 4:
                continue
            if l[1] == "+":
                status["running"] += 1
            elif l[1] == "-":
                status["stopped"] += 1
            elif l[1] == "?":
                status["upstart"] += 1
        # Build the output (string) message
        output = "Services\n"
        for k, v in iteritems(status):
            output += "{}: {}\n".format(k, v)
        self.set_result(output, separator=" ")

    return self.result()