From: Andy Bavier Date: Thu, 27 Jan 2011 17:02:39 +0000 (-0500) Subject: Fixes for non-eth0 devices X-Git-Tag: util-vserver-pl-0.4-22~1 X-Git-Url: http://git.onelab.eu/?p=util-vserver-pl.git;a=commitdiff_plain;h=acec183ad3b8f235afd6a86665dff6b6e761a50a Fixes for non-eth0 devices Fix bw limits on nodes that don't use eth0 as the default network device. --- diff --git a/python/bwlimit.py b/python/bwlimit.py index 674814b..ab760b5 100644 --- a/python/bwlimit.py +++ b/python/bwlimit.py @@ -523,7 +523,7 @@ def on(xid, dev = dev, share = None, minrate = None, maxrate = None, minexemptra maxexemptrate = cap[5] # Figure out what the current node bandwidth cap is - bwcap = get_bwcap() + bwcap = get_bwcap(dev) # Set defaults if share is None: @@ -661,7 +661,7 @@ def main(): # Defaults numeric = False - bwcap = get_bwcap() + bwcap = None (opts, argv) = getopt.getopt(sys.argv[1:], "d:nr:q:vh") for (opt, optval) in opts: @@ -678,6 +678,9 @@ def main(): elif opt == '-h': usage() + if not bwcap: + bwcap = get_bwcap(dev) + if bwcap == -1: return 0