From fc328f56fe41cd1f530ac5da0a09a5f8d87ef063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 22 Mar 2015 03:18:59 +0100 Subject: [PATCH] Use explicit default keyword for config issue4662 review8051002 --- res.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/res.py b/res.py index 35c852f37c..7081a3f58d 100644 --- a/res.py +++ b/res.py @@ -44,7 +44,7 @@ def ldap_connection(): scheme, port = 'ldap', 389 conn = ldap.initialize('%s://%s:%s/' % ( scheme, uri.hostname, uri.port or port)) - if config.getboolean(section, 'active_directory', False): + if config.getboolean(section, 'active_directory', default=False): conn.set_option(ldap.OPT_REFERRALS, 0) if 'tls' in uri.scheme: conn.start_tls_s() @@ -83,7 +83,7 @@ class User: 'onelevel': ldap.SCOPE_ONELEVEL, 'subtree': ldap.SCOPE_SUBTREE, }.get(scope) - uid = config.get(section, 'uid', 'uid') + uid = config.get(section, 'uid', default='uid') if filter_: filter_ = '(&(%s=%s)%s)' % (uid, login, filter_) else: @@ -139,7 +139,7 @@ class User: con = ldap_connection() if con: user = cls(Transaction().user) - uid = config.get(section, 'uid', 'uid') + uid = config.get(section, 'uid', default='uid') users = cls.ldap_search_user(user.login, con, attrs=[uid]) if users and len(users) == 1: [(dn, attrs)] = users @@ -161,7 +161,7 @@ class User: try: con = ldap_connection() if con: - uid = config.get(section, 'uid', 'uid') + uid = config.get(section, 'uid', default='uid') users = cls.ldap_search_user(login, con, attrs=[uid]) if users and len(users) == 1: [(dn, attrs)] = users