From 7fac271ccebb84743c39f553eb5ec013cf1d10aa Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Tue, 25 Oct 2011 11:07:12 -0400 Subject: SSSDConfig: Handle integer parsing more leniently Allow the base to be auto-detected rather than limited to base 10 Add hexadecimal integer test --- src/config/SSSDConfig.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/config/SSSDConfig.py') diff --git a/src/config/SSSDConfig.py b/src/config/SSSDConfig.py index 17ce38efd..76e4112f8 100644 --- a/src/config/SSSDConfig.py +++ b/src/config/SSSDConfig.py @@ -987,6 +987,9 @@ class SSSDDomain(SSSDConfigObject): if option_schema[0] == bool and \ type(value) == str: value = self.schema.bool_lookup[value.lower()] + elif option_schema[0] == int and type(value) == str: + # Make sure we handle any reasonable base + value = int(value, 0) else: value = option_schema[0](value) except ValueError: -- cgit