[sysadmin-bin] Remove the unused imports and the test prints



commit bc5e69b1ed80fcc3893974a3ce62ae62b81478d3
Author: Andrea Veri <av gnome org>
Date:   Fri Oct 3 15:04:27 2014 +0200

    Remove the unused imports and the test prints

 reset-my-password.py |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
---
diff --git a/reset-my-password.py b/reset-my-password.py
index 2db47cb..78342f5 100755
--- a/reset-my-password.py
+++ b/reset-my-password.py
@@ -3,20 +3,15 @@
 import ldap
 import ldap.filter
 import string
-import hashlib
 import smtplib
 import sys
 import os
 import ldap.modlist as modlist
-from base64 import b64encode
 from email.MIMEText import MIMEText
-from random import choice, randrange
 
 LDAP_GROUP_BASE='cn=groups,cn=accounts,dc=gnome,dc=org'
 LDAP_USER_BASE='cn=users,cn=accounts,dc=gnome,dc=org'
 
-print os.getenv('USER')
-print os.getenv('SUDO_USER')
 
 file = open('/home/admin/secret/freeipa','r')
 lines = file.readlines()
@@ -26,7 +21,7 @@ for line in lines:
                 dirty_password = line.split()
                 ldap_password = str(dirty_password)
 
-                sanitize_file=["ldap_password","=","\"","'","[","]"]
+                sanitize_file=["ldap_password", "\"", ":"]
                 for i in range(len(sanitize_file)):
                         ldap_password = ldap_password.replace(sanitize_file[i],"")
 file.close()


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