Use "foo is None" instead of "foo == None".
[mirror/userdir-ldap.git] / ud-generate
index a8ee854..4b589c5 100755 (executable)
@@ -309,7 +309,7 @@ def GenShadowSudo(accounts, File, untrusted, current_host):
          if 'sudoPassword' in a:
             for entry in a['sudoPassword']:
                Match = re.compile('^('+UUID_FORMAT+') (confirmed:[0-9a-f]{40}|unconfirmed) ([a-z0-9.,*-]+) ([^ ]+)$').match(entry)
-               if Match == None:
+               if Match is None:
                   continue
                uuid = Match.group(1)
                status = Match.group(2)
@@ -918,7 +918,7 @@ def ExtractDNSInfo(x):
             Algorithm = 2
          if key_prefix == 'ssh-ed25519':
             Algorithm = 4
-         if Algorithm == None:
+         if Algorithm is None:
             continue
          # and more from the registry
          sshfp_digest_codepoints = [ (1, 'sha1'), (2, 'sha256') ]
@@ -1142,7 +1142,7 @@ def get_hosts(ldap_conn):
                     "mXRecord", "ipHostNumber", "dnsTTL", "machine", "architecture",
                     "sshfpHostname"])
 
-   if HostAttrs == None:
+   if HostAttrs is None:
       raise UDEmptyList, "No Hosts"
 
    HostAttrs.sort(lambda x, y: cmp((GetAttr(x, "hostname")).lower(), (GetAttr(y, "hostname")).lower()))