X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=bwmon.py;h=f4c0133a0197910d3599ca263a30df6ca17384bc;hb=9e6b9c1ea9e020c55c85b433bac47231d63e9ffd;hp=ba59fe8f993e6ef7fd438089a70ac14ab9f82d12;hpb=f699ab76a8c8a5ba09d2286a833a8a05ecf8564c;p=nodemanager.git diff --git a/bwmon.py b/bwmon.py index ba59fe8..f4c0133 100644 --- a/bwmon.py +++ b/bwmon.py @@ -23,7 +23,8 @@ import socket import copy import threading -import bwlimitlxc as bwlimit +import plnode.bwlimit as bwlimit + import logger import tools import database @@ -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)