summaryrefslogtreecommitdiffstats
path: root/ipalib/config.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2014-06-13 12:47:48 +0200
committerPetr Viktorin <pviktori@redhat.com>2014-06-16 13:38:54 +0200
commit521df77744233f424ec68caa68548bede6e575fb (patch)
treee848271c1273f8bc78787bea39c439ef57731d49 /ipalib/config.py
parentda64c891e952d31f2c52000fb20f091c1c7136dd (diff)
downloadfreeipa-521df77744233f424ec68caa68548bede6e575fb.tar.gz
freeipa-521df77744233f424ec68caa68548bede6e575fb.tar.xz
freeipa-521df77744233f424ec68caa68548bede6e575fb.zip
ipalib.config: Don't autoconvert values to float
When api.env is loaded, strings that "look like" floats got auto-converted to floats. This is wrong, as the conversion to float can lose precision. Case in point: the api_version (e.g. '2.88') should never be interpreted as float. Do not automatically convert to float. We have two numeric options: startup_timeout and wait_for_dns. wait_for_dns is already converted to int when used in the code. Convert startup_timeout to float explicitly when used, so configuration that specified it with a decimal point continues to work. Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
Diffstat (limited to 'ipalib/config.py')
-rw-r--r--ipalib/config.py5
1 files changed, 0 insertions, 5 deletions
diff --git a/ipalib/config.py b/ipalib/config.py
index 709e06741..b12cfd321 100644
--- a/ipalib/config.py
+++ b/ipalib/config.py
@@ -259,11 +259,6 @@ class Env(object):
value = int(value)
elif key == 'basedn':
value = DN(value)
- else:
- try:
- value = float(value)
- except (TypeError, ValueError):
- pass
assert type(value) in (unicode, int, float, bool, NoneType, DN)
object.__setattr__(self, key, value)
self.__d[key] = value