[PATCH 1/5] Use ksdata to determine text password completeness

Jesse Keating jkeating at redhat.com
Mon Sep 24 22:47:25 UTC 2012


This is necessary for doing installs via kickstart where we've got the
data even though we haven't gone through the spoke.

Also handle the case where the account could be locked.
---
 pyanaconda/ui/tui/spokes/password.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/pyanaconda/ui/tui/spokes/password.py b/pyanaconda/ui/tui/spokes/password.py
index 98da8ac..b556af2 100644
--- a/pyanaconda/ui/tui/spokes/password.py
+++ b/pyanaconda/ui/tui/spokes/password.py
@@ -21,6 +21,7 @@
 
 from pyanaconda.ui.tui.spokes import NormalTUISpoke
 from pyanaconda.ui.tui.simpleline import TextWidget
+from pyanaconda.flags import flags
 import getpass
 
 import gettext
@@ -37,14 +38,16 @@ class PasswordSpoke(NormalTUISpoke):
 
     @property
     def completed(self):
-        return True
+        return bool(self.data.rootpw.password or self.data.rootpw.lock)
 
     @property
     def status(self):
-        if not self.data.rootpw.password:
-            return _("Root account disabled.")
-        else:
+        if self.data.rootpw.password:
             return _("Password is set.")
+        elif self.data.rootpw.lock:
+            return _("Root account is disabled.")
+        else:
+            return _("Password is not set.")
 
     def refresh(self, args = None):
         NormalTUISpoke.refresh(self, args)
-- 
1.7.11.4



More information about the anaconda-patches mailing list