Add error output for missing data, comment out a debug statement
authorBrian Dolbec <dolsen@gentoo.org>
Sat, 22 Jun 2013 18:11:19 +0000 (18:11 +0000)
committerBrian Dolbec <dolsen@gentoo.org>
Sat, 22 Jun 2013 23:00:58 +0000 (16:00 -0700)
Error for 'undefined' in values obtained from ldap

gkeyldap/cli.py

index 15e410e1726a9d3288289f93feda39e078e68eac..d4971d08f6b3978767a3b6ee5b07ab4c899d99d2 100644 (file)
@@ -194,7 +194,7 @@ class Main(object):
     @staticmethod
     def build_gkeylist(info):
         keyinfo = []
-        logger.debug("build_gkeylist, info = %s" % str(info))
+        #logger.debug("build_gkeylist, info = %s" % str(info))
         for x in GKEY._fields:
             field = gkey2ldap_map[x]
             if not field:
@@ -206,6 +206,9 @@ class Main(object):
                     value = values[0]
                 else:
                     value = values
+                if 'undefined' in values:
+                    logger.error('%s = "undefined" for %s, %s'
+                        %(field, info['uid'][0], info['cn'][0]))
                 keyinfo.append(value)
             except KeyError:
                 logger.error("Missing %s for %s, %s"