import copy
import threading
-import bwlimitlxc as bwlimit
+import plnode.bwlimit as bwlimit
+
import logger
import tools
import database
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
# 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()