Comment 19 for bug 805423

Revision history for this message
Till Klampaeckel (till-php) wrote :

Here is an idea for a patch – but I am not sure if it actually works:

--- /usr/share/pyshared/landscape/lib/sysstats.py.orig 2012-07-26 15:26:42.000000000 +0000
+++ /usr/share/pyshared/landscape/lib/sysstats.py 2012-07-26 15:32:38.000000000 +0000
@@ -55,6 +55,13 @@ class MemoryStats(object):
 def get_logged_in_users():
     result = getProcessOutputAndValue("who", ["-q"], env=os.environ)

+ def logged_in_users_err_callback(result):
+ """ Errback from getProcessOutputAndValue """
+ out, err, code = result
+ raise Exception("Error getting users exited %d with error: %s (%s)" % (code, err, out))
+
+ result.addErrback(logged_in_users_err_callback)
+
     def parse_output((stdout_data, stderr_data, status)):
         if status != 0:
             raise CommandError(stderr_data)