]> git.decadent.org.uk Git - dak.git/commitdiff
import-users
authorJoerg Jaspert <joerg@debian.org>
Wed, 25 Nov 2009 20:57:00 +0000 (21:57 +0100)
committerJoerg Jaspert <joerg@debian.org>
Wed, 25 Nov 2009 20:57:00 +0000 (21:57 +0100)
delete no longer existing users instead of just needlessly spamming us
with their names

Signed-off-by: Joerg Jaspert <joerg@debian.org>
dak/import_users_from_passwd.py

index 07c6193aede7a23c8efaf8e7765a8d023d870d58..958486710251b99e5ac5e2ebf5a6cf75efef37b2 100755 (executable)
@@ -99,8 +99,9 @@ def main ():
     keys = postgres_unames.keys()
     keys.sort()
     for uname in keys:
-        if not passwd_unames.has_key(uname)and not known_postgres_unames.has_key(uname):
-            print "W: %s is in Postgres but not the passwd file or list of known Postgres users." % (uname)
+        if not passwd_unames.has_key(uname) and not known_postgres_unames.has_key(uname):
+            print "I: Deleting %s from Postgres, no longer in passwd or list of known Postgres users" % (uname)
+            q = session.execute('DROP USER "%s"' % (uname))
 
     keys = passwd_unames.keys()
     keys.sort()