From 078771f125e31d31fb0b86836302adf4b949547a Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Wed, 7 Oct 2015 17:17:59 -0400 Subject: [PATCH] Improve debug output For some exceptions, we don't get a message object with an info key, so be more tolerant. Also, dump the DN when we dump the general data. Signed-off-by: Dan Scott --- tools/patron-load/ldap_osrf_sync | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/patron-load/ldap_osrf_sync b/tools/patron-load/ldap_osrf_sync index ed3243b197..75a1c81af6 100755 --- a/tools/patron-load/ldap_osrf_sync +++ b/tools/patron-load/ldap_osrf_sync @@ -330,6 +330,7 @@ def find_ldap_users(con, ldap_filter, attributes, auth): user = User(raw_user, raw_atts) if ARGS.dump_ldap: dump_data(raw_atts) + print("dn = '%s'" % (raw_user)) if ARGS.create_users: res = create_evergreen_user(auth, user) if res: @@ -690,7 +691,8 @@ def main(args=None): results = ldap_query(con, AUTHTOKEN) except ldap.LDAPError, exc: - print >> sys.stderr, "Could not connect: " + exc.message['info'] + print >> sys.stderr, "Could not connect: " + print >> sys.stderr, exc.message if type(exc.message) == dict and exc.message.has_key('desc'): print >> sys.stderr, exc.message['desc'] else: -- 2.11.0