X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=bwmon.py;h=f4c0133a0197910d3599ca263a30df6ca17384bc;hb=34bbf772786e0e674d2b83ddfb079cb060830ff1;hp=affa0929087bbcb91248e21c1e388c7fe3ad594a;hpb=e5fe8f0e38fa96e588d8674bc1352a39e3c4afe6;p=nodemanager.git diff --git a/bwmon.py b/bwmon.py index affa092..f4c0133 100644 --- a/bwmon.py +++ b/bwmon.py @@ -23,9 +23,10 @@ import socket import copy import threading +import plnode.bwlimit as bwlimit + import logger import tools -import bwlimit import database from config import Config @@ -422,7 +423,7 @@ class Slice: if (runningrates['maxrate'] != new_maxrate) or \ (runningrates['minrate'] != self.MinRate * 1000) or \ (runningrates['maxexemptrate'] != new_maxi2rate) or \ - (runningrates['minexemptrate'] != self.Mini2Rate * 1000) or \ + ('minexemptrate' in runningrates and runningrates['minexemptrate'] != self.Mini2Rate * 1000) or \ (runningrates['share'] != self.Share): # Apply parameters bwlimit.set(xid = self.xid, dev = dev_default, @@ -496,6 +497,9 @@ def sync(nmdbcopy): if default_MaxRate == -1: default_MaxRate = 1000000 + # xxx $Id$ + # with svn we used to have a trick to detect upgrades of this file + # this has gone with the move to git, without any noticeable effect on operations though try: f = open(DB_FILE, "r+") logger.verbose("bwmon: Loading %s" % DB_FILE)