From 2d023e6ec425b92a7b9be4e6b732444a7a62f00d Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Thu, 10 Sep 2009 19:11:14 -0400 Subject: [PATCH] Blacklist orphaned/expired from updateprograms --- ceo/console/updateprograms.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ceo/console/updateprograms.py b/ceo/console/updateprograms.py index c4cc174..e8331c1 100644 --- a/ceo/console/updateprograms.py +++ b/ceo/console/updateprograms.py @@ -1,6 +1,8 @@ import ldap, sys, termios from ceo import members, uwldap, ldapi +blacklist = ('orphaned', 'expired') + class UpdatePrograms: help = ''' updateprograms @@ -20,7 +22,7 @@ Interactively updates the program field for an account by querying uwdir. user = user[0][1] oldprog = member.get('program', [''])[0] newprog = user.get('ou', [''])[0] - if oldprog == newprog or newprog == '': + if oldprog == newprog or newprog == '' or newprog.lower() in blacklist: continue sys.stdout.write("%s: '%s' => '%s'? (y/n) " % (uid, oldprog, newprog)) new = old = termios.tcgetattr(fd)