[sysadmin-bin] Add the print_inactive_accounts option in place



commit 87a951724154a7589f07ace62acd25f7c68e6d2f
Author: Andrea Veri <av gnome org>
Date:   Mon Mar 24 13:43:32 2014 +0100

    Add the print_inactive_accounts option in place

 cleanup-inactive-ldap-accounts.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/cleanup-inactive-ldap-accounts.py b/cleanup-inactive-ldap-accounts.py
index 372ae33..6870540 100755
--- a/cleanup-inactive-ldap-accounts.py
+++ b/cleanup-inactive-ldap-accounts.py
@@ -52,7 +52,8 @@ now = time.time()
 for user, last_pushed in last_pushed_times.iteritems():
     if last_pushed < now - 2 * 365 * 24 * 60 * 60:
         last_pushed = time.gmtime(last_pushed)
-                       print ("%s: %s" % (user, time.strftime("%d-%m-%Y", last_pushed)), end='')
+       if options.print_inactive_accounts:
+            print ("%s: %s" % (user, time.strftime("%d-%m-%Y", last_pushed)), end='\n')
 
 def user_is_current(username):
      return username in last_pushed_times and last_pushed_times[username] >= now - 2 * 365 * 24 * 60 * 60


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]