[rhel7/master/f21] Don't require user creation when root is locked (#1030626)

Brian C. Lane bcl at redhat.com
Fri Aug 1 22:38:17 UTC 2014


The only way for the root account to be locked is via a kickstart.
Assume the user meant what they said and don't require a user account to
be created.

Resolves: rhbz#1030626
---
 pyanaconda/ui/gui/spokes/user.py | 6 ++++--
 pyanaconda/ui/tui/spokes/user.py | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/user.py b/pyanaconda/ui/gui/spokes/user.py
index a17033e..95cc8b7 100644
--- a/pyanaconda/ui/gui/spokes/user.py
+++ b/pyanaconda/ui/gui/spokes/user.py
@@ -248,8 +248,10 @@ class UserSpoke(FirstbootSpokeMixIn, NormalSpoke):
 
     @property
     def mandatory(self):
-        # mandatory only if root account is disabled
-        return (not self.data.rootpw.password) or self.data.rootpw.lock
+        """ Only mandatory if the root pw hasn't been set in the UI
+            eg. not mandatory if the root account was locked in a kickstart
+        """
+        return not self.data.rootpw.password and not self.data.rootpw.lock
 
     def apply(self):
         # set the password only if the user enters anything to the text entry
diff --git a/pyanaconda/ui/tui/spokes/user.py b/pyanaconda/ui/tui/spokes/user.py
index 6a6e78a..6d5e4b5 100644
--- a/pyanaconda/ui/tui/spokes/user.py
+++ b/pyanaconda/ui/tui/spokes/user.py
@@ -105,8 +105,10 @@ class UserSpoke(FirstbootSpokeMixIn, EditTUISpoke):
 
     @property
     def mandatory(self):
-        """ Only mandatory if root account is disabled. """
-        return not bool(self.data.rootpw.password) or self.data.rootpw.lock
+        """ Only mandatory if the root pw hasn't been set in the UI
+            eg. not mandatory if the root account was locked in a kickstart
+        """
+        return not self.data.rootpw.password and not self.data.rootpw.lock
 
     @property
     def status(self):
-- 
1.9.3



More information about the anaconda-patches mailing list