summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Sivak <msivak@redhat.com>2013-02-27 17:05:23 +0100
committerMartin Sivak <msivak@redhat.com>2013-03-01 11:36:48 +0100
commit656b4fb968d532f1e89b04b0a55ab03bad08e5a9 (patch)
treef5a55c8626d1cef668a44579ea557e79420b6a3d
parent3b0adea181edb0e334a973face994488d07bc5c4 (diff)
downloadanaconda-master.tar.gz
anaconda-master.tar.xz
anaconda-master.zip
Behave nice when root password is set by kickstartHEADmaster
-rw-r--r--pyanaconda/ui/gui/spokes/password.py25
1 files changed, 21 insertions, 4 deletions
diff --git a/pyanaconda/ui/gui/spokes/password.py b/pyanaconda/ui/gui/spokes/password.py
index 7e62ec782..e6bb5a310 100644
--- a/pyanaconda/ui/gui/spokes/password.py
+++ b/pyanaconda/ui/gui/spokes/password.py
@@ -53,6 +53,7 @@ class PasswordSpoke(FirstbootSpokeMixIn, NormalSpoke):
self._password = None
self._error = False
self._oldweak = None
+ self._kickstarted = False
def initialize(self):
NormalSpoke.initialize(self)
@@ -60,6 +61,11 @@ class PasswordSpoke(FirstbootSpokeMixIn, NormalSpoke):
self.pw = self.builder.get_object("pw")
self.confirm = self.builder.get_object("confirm")
+ self._kickstarted = self.data.rootpw.seen
+ if self._kickstarted:
+ self.pw.set_placeholder_text(_("The password was set by kickstart."))
+ self.confirm.set_placeholder_text(_("The password was set by kickstart."))
+
def refresh(self):
# self.setCapsLockLabel()
self.pw.grab_focus()
@@ -76,7 +82,9 @@ class PasswordSpoke(FirstbootSpokeMixIn, NormalSpoke):
def status(self):
if self._error:
return _("Error setting root password")
- if self.data.rootpw.password:
+ elif self._kickstarted:
+ return _("Root password was set by kickstart")
+ elif self.data.rootpw.password:
return _("Root password is set")
elif self.data.rootpw.lock:
return _("Root account is disabled")
@@ -87,11 +95,17 @@ class PasswordSpoke(FirstbootSpokeMixIn, NormalSpoke):
def mandatory(self):
return not any(user for user in self.data.user.userList
if "wheel" in user.groups)
-
+
def apply(self):
+ if self._password == "" and self._kickstarted:
+ return
+
self.data.rootpw.password = cryptPassword(self._password)
self.data.rootpw.isCrypted = True
self.data.rootpw.lock = False
+ self._kickstarted = False
+ self.pw.set_placeholder_text("")
+ self.confirm.set_placeholder_text("")
@property
def completed(self):
@@ -106,8 +120,11 @@ class PasswordSpoke(FirstbootSpokeMixIn, NormalSpoke):
confirm = self.confirm.get_text()
if not pw and not confirm:
- self._error = _("You must provide and confirm a password.")
- return False
+ if self._kickstarted:
+ return True
+ else:
+ self._error = _("You must provide and confirm a password.")
+ return False
try:
self._error = validatePassword(pw, confirm)