From acec183ad3b8f235afd6a86665dff6b6e761a50a Mon Sep 17 00:00:00 2001 From: Andy Bavier Date: Thu, 27 Jan 2011 12:02:39 -0500 Subject: [PATCH] Fixes for non-eth0 devices Fix bw limits on nodes that don't use eth0 as the default network device. --- python/bwlimit.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 -- 2.43.0