git://git.onelab.eu
/
util-vserver-pl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixes for non-eth0 devices
[util-vserver-pl.git]
/
python
/
bwlimit.py
diff --git
a/python/bwlimit.py
b/python/bwlimit.py
index
674814b
..
ab760b5
100644
(file)
--- 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
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:
# Set defaults
if share is None:
@@
-661,7
+661,7
@@
def main():
# Defaults
numeric = False
# Defaults
numeric = False
- bwcap =
get_bwcap()
+ bwcap =
None
(opts, argv) = getopt.getopt(sys.argv[1:], "d:nr:q:vh")
for (opt, optval) in opts:
(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()
elif opt == '-h':
usage()
+ if not bwcap:
+ bwcap = get_bwcap(dev)
+
if bwcap == -1:
return 0
if bwcap == -1:
return 0