[master/f21-branch][PATCH] Strip suggested usernames to 8 characters

Vratislav Podzimek vpodzime at redhat.com
Tue Aug 26 08:40:50 UTC 2014


This is a practical and widely used pattern.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 pyanaconda/users.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pyanaconda/users.py b/pyanaconda/users.py
index 82cd2d3..f25c8fa 100644
--- a/pyanaconda/users.py
+++ b/pyanaconda/users.py
@@ -192,8 +192,9 @@ def guess_username(fullname):
     if len(fullname) > 1:
         username = fullname[0].decode("utf-8")[0].lower() + username
 
+    # strip accents and make the username at most 8 characters long
     username = strip_accents(username).encode("utf-8")
-    return username
+    return username[0:8]
 
 class Users:
     def __init__ (self):
-- 
1.9.3



More information about the anaconda-patches mailing list