X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=bwmon.py;h=476ef6daebc151780aed229660670be885d80a92;hb=ac6786141feadccdc48b819ab21a825a54881ded;hp=0b825cf45a56e85ffa0e0a8a38f80f7c3523bab8;hpb=d235d740614a027b111b37ce84f1d9edaf113922;p=nodemanager.git diff --git a/bwmon.py b/bwmon.py index 0b825cf..476ef6d 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, @@ -481,8 +482,8 @@ def sync(nmdbcopy): period, \ default_MaxRate, \ default_Maxi2Rate, \ - default_MaxKByte,\ - default_Maxi2KByte,\ + default_MaxKByte, \ + default_Maxi2KByte, \ default_Share, \ dev_default @@ -655,7 +656,7 @@ def sync(nmdbcopy): # Update byte counts slice.update(kernelhtbs[xid], live[xid]['_rspec']) - logger.verbose("bwmon: Saving %s slices in %s" % (slices.keys().__len__(),DB_FILE)) + logger.verbose("bwmon: Saving %s slices in %s" % (slices.keys().__len__(), DB_FILE)) f = open(DB_FILE, "w") pickle.dump((version, slices, deaddb), f) f.close()