ud-generate: deal with users without loginShell
[mirror/userdir-ldap.git] / ud-gpgimport
index 4e26a5e..103f472 100755 (executable)
@@ -95,8 +95,8 @@ def load_keys_from_gpg(keyrings):
          continue
       keys[fingerprint] = pgp_uid
 
-   if Keys.close() != None:
-      raise "Error","GPG failed"
+   if Keys.close() is not None:
+      raise Exception("GPG failed")
 
    return keys
 
@@ -177,9 +177,9 @@ for fpr in pgpkeys:
       continue;
 
    UID = GetUID(l,SplitEmail(pgp_uid),UnknownMap);
-   if UID[0] == None:
+   if UID[0] is None:
       print "Unassigned key in keyrings: %s, belonging to %s"%(fpr, pgp_uid)
-      if UID[1] != None:
+      if UID[1] is not None:
          for x in UID[1]: print x;
       print "MISSING " + fpr;
       continue;
@@ -209,7 +209,7 @@ print Ignored,"keys already in the directory (ignored)";
 
 # Look for unmatched keys
 for x in KeyMap.keys():
-   if KeyMap[x][1] == 0 and not x in pgpkeys_extra:
+   if KeyMap[x][1] == 0 and x not in pgpkeys_extra:
       print "key %s belonging to %s removed"%(x,KeyMap[x][0]);
       if KeyCount.has_key(KeyMap[x][0]) :
          KeyCount[KeyMap[x][0]] = KeyCount[KeyMap[x][0]] - 1