import copy
import threading
+import plnode.bwlimit as bwlimit
+
import logger
import tools
-import bwlimit
import database
from config import Config
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,
period, \
default_MaxRate, \
default_Maxi2Rate, \
- default_MaxKByte,\
- default_Maxi2KByte,\
+ default_MaxKByte, \
+ default_Maxi2KByte, \
default_Share, \
dev_default
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)
# 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()