diff options
-rw-r--r-- | ipalib/config.py | 5 | ||||
-rw-r--r-- | ipapython/ipautil.py | 2 | ||||
-rw-r--r-- | ipapython/platform/fedora16/service.py | 2 | ||||
-rw-r--r-- | ipatests/test_ipalib/test_config.py | 5 |
4 files changed, 5 insertions, 9 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 diff --git a/ipapython/ipautil.py b/ipapython/ipautil.py index 844dbb687..d95983b20 100644 --- a/ipapython/ipautil.py +++ b/ipapython/ipautil.py @@ -1135,6 +1135,7 @@ def wait_for_open_ports(host, ports, timeout=0): in seconds may be specified to limit the wait. If the timeout is exceeded, socket.timeout exception is raised. """ + timeout = float(timeout) if not isinstance(ports, (tuple, list)): ports = [ports] @@ -1156,6 +1157,7 @@ def wait_for_open_socket(socket_name, timeout=0): Wait until the specified socket on the local host is open. Timeout in seconds may be specified to limit the wait. """ + timeout = float(timeout) op_timeout = time.time() + timeout while True: diff --git a/ipapython/platform/fedora16/service.py b/ipapython/platform/fedora16/service.py index 41c241ae5..86403d825 100644 --- a/ipapython/platform/fedora16/service.py +++ b/ipapython/platform/fedora16/service.py @@ -152,7 +152,7 @@ class Fedora16CAService(Fedora16Service): 'The httpd proxy is not installed, wait on local port') use_proxy = False root_logger.debug('Waiting until the CA is running') - timeout = api.env.startup_timeout + timeout = float(api.env.startup_timeout) op_timeout = time.time() + timeout while time.time() < op_timeout: try: diff --git a/ipatests/test_ipalib/test_config.py b/ipatests/test_ipalib/test_config.py index f896b8936..e04dd9530 100644 --- a/ipatests/test_ipalib/test_config.py +++ b/ipatests/test_ipalib/test_config.py @@ -43,8 +43,7 @@ good_vars = ( ('trailing_whitespace', u' value ', u'value'), ('an_int', 42, 42), ('int_repr', ' 42 ', 42), - ('a_float', 3.14, 3.14), - ('float_repr', ' 3.14 ', 3.14), + ('not_a_float', '3.14', u'3.14'), ('true', True, True), ('true_repr', ' True ', True), ('false', False, False), @@ -406,7 +405,7 @@ class test_Env(ClassChecker): assert o.yes is True assert o.no is False assert o.number == 42 - assert o.floating == 3.14 + assert o.floating == '3.14' def new(self, in_tree=False): """ |