severity 324051 minor
tags 324051 + patch pending
thanks

* Martin Michlmayr <[EMAIL PROTECTED]> [2005-08-25 01:34]:
> > Jacks df parsing routine doesn't work, though, it looks for
> > "Available" instead of "Avail" and keep_free isn't defined anywhere
> > (yay for dynamic typing).
> 
> It is "Available" when your term is wide enough... you're right about
> keep_free, though - thanks for catching this.  I'll fix this, probably
> make the routine more robust and send a patch upstream later.

Here's a patch:


Fix the alternative path of jack_functions.df():
 - close p after reading from it, not before...
 - get rid of 'keep_free' which is no defined.  It's really cf['_keep_free']
   but it should not be there anyway since the code which calls
   jack_functions.df() will deduct it.
 - also close p when 'Available' is not found (unlikely, but still...)

--- jack_functions.py~  2005-11-01 21:06:30.000000000 +0000
+++ jack_functions.py   2005-11-01 21:14:33.000000000 +0000
@@ -53,9 +53,10 @@
         s = string.split(string.rstrip(p.readline()))
         for i in range(len(s)):
             if s[i] == "Available":
-                p.close()
                 s = string.split(string.rstrip(p.readline()))
-                return int(s[i]) * long(blocksize) - long(keep_free)
+                p.close()
+                return int(s[i]) * long(blocksize)
+        p.close()
 
 def get_sysload_linux_proc():
     "extract sysload from /proc/loadavg, linux only (?)"

-- 
Martin Michlmayr
http://www.cyrius.com/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to