From 712bb188875ab1e8338e2e41a23b5300a16a7ee9 Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Wed, 25 Nov 2009 21:57:00 +0100 Subject: [PATCH] import-users delete no longer existing users instead of just needlessly spamming us with their names Signed-off-by: Joerg Jaspert --- dak/import_users_from_passwd.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dak/import_users_from_passwd.py b/dak/import_users_from_passwd.py index 07c6193a..95848671 100755 --- a/dak/import_users_from_passwd.py +++ b/dak/import_users_from_passwd.py @@ -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() -- 2.39.5