X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=ud-gpgimport;h=103f472b008d0019b7223868a4862c5909535398;hb=refs%2Fheads%2Fsalsa;hp=4e26a5e8bb9905a9ba95821392792ab062c326bc;hpb=50b1233bdf1dbc75ee87bbff79e709691440d8b8;p=mirror%2Fuserdir-ldap.git diff --git a/ud-gpgimport b/ud-gpgimport index 4e26a5e..103f472 100755 --- a/ud-gpgimport +++ b/ud-gpgimport @@ -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