stupid thinko
authorAdam Glasgall <adam@crossproduct.net>
Thu, 25 Apr 2013 01:14:13 +0000 (21:14 -0400)
committerAdam Glasgall <adam@crossproduct.net>
Thu, 25 Apr 2013 01:14:13 +0000 (21:14 -0400)
debian/changelog
host/usr/sbin/invirt-availability

index 217d663..ab3e8cc 100644 (file)
@@ -1,3 +1,9 @@
+invirt-remote (0.4.15~glasgall8) precise; urgency=low
+
+  * Oops, right, Python doesn't auto-coerce strings to ints. Thankfully.
+
+ -- Adam Glasgall <glasgall@mit.edu>  Wed, 24 Apr 2013 21:13:44 -0400
+
 invirt-remote (0.4.15~glasgall7) precise; urgency=low
 
   * Xen balloon information now lives in files in
index 3ff23a8..729c229 100644 (file)
@@ -34,8 +34,8 @@ def main(argv):
 
     free_memory = int(xminfo['free_memory']) * 1024
 
-    currentallocation = open('/sys/devices/system/xen_memory/xen_memory0/info/current_kb', 'r').read()
-    minimumtarget = open('/sys/devices/system/xen_memory/xen_memory0/target_kb', 'r').read()
+    currentallocation = int(open('/sys/devices/system/xen_memory/xen_memory0/info/current_kb', 'r').read())
+    minimumtarget = int(open('/sys/devices/system/xen_memory/xen_memory0/target_kb', 'r').read())
     p = Popen(['/usr/sbin/xm', 'info', '-c'], stdout=PIPE)
     output = p.communicate()[0]
     if p.returncode != 0: