summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Options.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-10-09 07:13:46 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-10-09 07:13:46 -0400
commit7a2a69a0c5a79c88874dd3ea3c9cecfb243fad4f (patch)
treeabde34166426cc2c67eec2b7015872544c4b17cd /src/lib/Bcfg2/Options.py
parenta4680a0a4ffbf7c2acf07158c1840bc849c563e7 (diff)
downloadbcfg2-7a2a69a0c5a79c88874dd3ea3c9cecfb243fad4f.tar.gz
bcfg2-7a2a69a0c5a79c88874dd3ea3c9cecfb243fad4f.tar.bz2
bcfg2-7a2a69a0c5a79c88874dd3ea3c9cecfb243fad4f.zip
fix pylint unit test errors
Diffstat (limited to 'src/lib/Bcfg2/Options.py')
-rw-r--r--src/lib/Bcfg2/Options.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/Bcfg2/Options.py b/src/lib/Bcfg2/Options.py
index 0b4b1b047..467d9d6d7 100644
--- a/src/lib/Bcfg2/Options.py
+++ b/src/lib/Bcfg2/Options.py
@@ -333,7 +333,10 @@ def get_bool(val):
else:
raise ValueError
+
def get_size(value):
+ """ Given a number of bytes in a human-readable format (e.g.,
+ '512m', '2g'), get the absolute number of bytes as an integer """
if value == -1:
return value
mat = re.match("(\d+)([KkMmGg])?", value)