[PATCH] Require root password spoke be visited (#859069)

Jesse Keating jkeating at redhat.com
Sat Oct 6 03:05:02 UTC 2012


Give up on getting cute with payload data to set required or not, just
always make the user visit it.  Also don't default the kickstart data to
locked, that can confuse the UI
---
 data/interactive-defaults.ks         |  1 -
 pyanaconda/ui/gui/spokes/password.py | 12 ++++--------
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/data/interactive-defaults.ks b/data/interactive-defaults.ks
index 0046cc3..f692ccd 100644
--- a/data/interactive-defaults.ks
+++ b/data/interactive-defaults.ks
@@ -2,4 +2,3 @@
 # This is not loaded if a kickstart file is provided on the command line.
 auth --enableshadow --passalgo=sha512
 firstboot --enable
-rootpw --lock
diff --git a/pyanaconda/ui/gui/spokes/password.py b/pyanaconda/ui/gui/spokes/password.py
index 9f5d4d9..74acd4e 100644
--- a/pyanaconda/ui/gui/spokes/password.py
+++ b/pyanaconda/ui/gui/spokes/password.py
@@ -55,8 +55,6 @@ class PasswordSpoke(NormalSpoke):
 
     def initialize(self):
         NormalSpoke.initialize(self)
-        # Set the rootpw to locked by default, setting a password is optional
-        self.data.rootpw.lock = True
         # place holders for the text boxes
         self.pw = self.builder.get_object("pw")
         self.confirm = self.builder.get_object("confirm")
@@ -77,10 +75,12 @@ class PasswordSpoke(NormalSpoke):
     def status(self):
         if self._error:
             return _("Error setting root password")
+        if self.data.rootpw.password:
+            return _("Root password is set")
         elif self.data.rootpw.lock:
             return _("Root account is disabled")
         else:
-            return _("Root password is set")
+            return _("Root password is not set")
 
     def apply(self):
         if self._password:
@@ -95,11 +95,7 @@ class PasswordSpoke(NormalSpoke):
 
     @property
     def completed(self):
-        # FUTURE -- update completed to false if package payload doesn't
-        # include firstboot and some environment to run it in
-        # We are by default complete, but locked.  If a user attempts to set
-        # a password but fails, then we are no longer complete.
-        return not self._error
+        return bool(self.data.rootpw.password or self.data.rootpw.lock)
 
     def _validatePassword(self):
         # Do various steps to validate the password
-- 
1.7.11.4



More information about the anaconda-patches mailing list