bwmon: Fixed extra notification when 1 of 2 limits weren't exceeded.
authorFaiyaz Ahmed <faiyaza@cs.princeton.edu>
Thu, 21 Aug 2008 16:43:10 +0000 (16:43 +0000)
committerFaiyaz Ahmed <faiyaza@cs.princeton.edu>
Thu, 21 Aug 2008 16:43:10 +0000 (16:43 +0000)
bwmon.py

index 10cdd95..19e28b4 100644 (file)
--- a/bwmon.py
+++ b/bwmon.py
@@ -314,7 +314,7 @@ class Slice:
                   'date': time.asctime(time.gmtime()) + " GMT",
                   'period': format_period(period)}
 
-        if new_maxrate != self.MaxRate:
+        if new_maxrate != (self.MaxRate * 1000):
             # Format template parameters for low bandwidth message
             params['class'] = "low bandwidth"
             params['bytes'] = format_bytes(usedbytes - self.bytes)
@@ -325,7 +325,7 @@ class Slice:
             message += template % params
             logger.log("bwmon:   ** %(slice)s %(class)s capped at %(new_maxrate)s/s " % params)
 
-        if new_maxexemptrate != self.Maxi2Rate:
+        if new_maxexemptrate != (self.Maxi2Rate * 1000):
             # Format template parameters for high bandwidth message
             params['class'] = "high bandwidth"
             params['bytes'] = format_bytes(usedi2bytes - self.i2bytes)