[PATCH] If a root password is set, don't show the spoke (#910355, #1041405).
Chris Lumens
clumens at redhat.com
Thu Jan 16 16:14:14 UTC 2014
Basically, if whoever made the kickstart file set a root password, we do not
want whoever is doing the install to be able to override it.
---
pyanaconda/ui/gui/spokes/password.py | 8 +++++++-
pyanaconda/ui/tui/spokes/password.py | 8 +++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/password.py b/pyanaconda/ui/gui/spokes/password.py
index 0246643..1ef7a0b 100644
--- a/pyanaconda/ui/gui/spokes/password.py
+++ b/pyanaconda/ui/gui/spokes/password.py
@@ -1,6 +1,6 @@
# root password spoke class
#
-# Copyright (C) 2012 Red Hat, Inc.
+# Copyright (C) 2012-2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
@@ -17,8 +17,10 @@
# Red Hat, Inc.
#
# Red Hat Author(s): Jesse Keating <jkeating at redhat.com>
+# Chris Lumens <clumens at redhat.com>
#
+from pyanaconda.flags import flags
from pyanaconda.i18n import _, CN_
from pyanaconda.users import cryptPassword, validatePassword
@@ -141,6 +143,10 @@ class PasswordSpoke(FirstbootSpokeMixIn, NormalSpoke, GUISpokeInputCheckHandler)
def completed(self):
return bool(self.data.rootpw.password or self.data.rootpw.lock)
+ @property
+ def showable(self):
+ return not (self.completed and flags.automatedInstall)
+
def _checkPasswordEmpty(self, inputcheck):
"""Check whether a password has been specified at all."""
diff --git a/pyanaconda/ui/tui/spokes/password.py b/pyanaconda/ui/tui/spokes/password.py
index 938559e..870fff4 100644
--- a/pyanaconda/ui/tui/spokes/password.py
+++ b/pyanaconda/ui/tui/spokes/password.py
@@ -1,6 +1,6 @@
# Root password text spoke
#
-# Copyright (C) 2012 Red Hat, Inc.
+# Copyright (C) 2012-2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
@@ -18,11 +18,13 @@
#
# Red Hat Author(s): Martin Sivak <msivak at redhat.com>
# Jesse Keating <jkeating at redhat.com>
+# Chris Lumens <clumens at redhat.com>
#
from pyanaconda.ui.tui.spokes import EditTUIDialog, EditTUISpokeEntry
from pyanaconda.ui.common import FirstbootSpokeMixIn
from pyanaconda.ui.tui.simpleline import TextWidget
+from pyanaconda.flags import flags
from pyanaconda.i18n import N_, _
class PasswordSpoke(FirstbootSpokeMixIn, EditTUIDialog):
@@ -38,6 +40,10 @@ class PasswordSpoke(FirstbootSpokeMixIn, EditTUIDialog):
return bool(self.data.rootpw.password or self.data.rootpw.lock)
@property
+ def showable(self):
+ return not (self.completed and flags.automatedInstall)
+
+ @property
def mandatory(self):
return not any(user for user in self.data.user.userList
if "wheel" in user.groups)
--
1.8.3.1
More information about the anaconda-patches
mailing list