Module: check_mk
Branch: master
Commit: 0569d8ec91444fcfb90e17e33a7e59b80c940ace
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0569d8ec91444f…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Feb 21 14:28:17 2013 +0100
FIX: check_mk_base: fixed rounding error in get_bytes_human_readable
---
ChangeLog | 1 +
modules/check_mk_base.py | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 7178e6b..e06afbf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -41,6 +41,7 @@
* Linux agent: limit netstat to 10 seconds
* ps: Allow %1, %2, .. instead of %s in process_inventory. That allows
reordering of matched groups
+ * FIX: check_mk_base: fixed rounding error in get_bytes_human_readable
Multisite:
* FIX: Fixed problem with error during localization scanning
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index a547100..7fd93c1 100755
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -1290,6 +1290,7 @@ def savefloat(f):
# The unit parameter simply changes the returned string, but does not interfere
# with any calcluations
def get_bytes_human_readable(b, base=1024.0, bytefrac=True, unit="B"):
+ base = float(base)
# Handle negative bytes correctly
prefix = ''
if b < 0: