- set_bwlimit: interpret only minrate = None to mean turn off bwlimits
Mark Huang [Wed, 7 Feb 2007 04:20:59 +0000 (04:20 +0000)]
python/vserver.py

index c6d07b6..1c85a94 100644 (file)
@@ -212,11 +212,11 @@ class VServer:
                     exempt_min = None, exempt_max = None,
                     share = None, dev = "eth0"):
 
-        if minrate:
+        if minrate is None:
+            bwlimit.off(self.ctx, dev)
+        else:
             bwlimit.on(self.ctx, dev, share,
                        minrate, maxrate, exempt_min, exempt_max)
-        else:
-            bwlimit.off(self.ctx, dev)
 
     def get_bwlimit(self, dev = "eth0"):