These patches are needed for the Initial Setup, together with one patch for its own code.
Vratislav Podzimek (3): Be more specific about what was set in the kickstart (#963970) Add flag indicating if running in the Initial Setup Refer to installation not kickstart in the Initial Setup (#963968)
pyanaconda/flags.py | 1 + pyanaconda/ui/gui/spokes/password.py | 28 ++++++++++++++++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-)
The root account may be e.g. locked in the kickstart.
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com --- pyanaconda/ui/gui/spokes/password.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/password.py b/pyanaconda/ui/gui/spokes/password.py index ff029ea..7cd6e49 100644 --- a/pyanaconda/ui/gui/spokes/password.py +++ b/pyanaconda/ui/gui/spokes/password.py @@ -19,6 +19,7 @@ # Red Hat Author(s): Jesse Keating jkeating@redhat.com #
+# pylint: disable-msg=E0611 from gi.repository import Gtk
from pyanaconda.i18n import _, N_ @@ -58,7 +59,7 @@ class PasswordSpoke(FirstbootSpokeMixIn, NormalSpoke): self.confirm = self.builder.get_object("confirm")
self._kickstarted = self.data.rootpw.seen - if self._kickstarted: + if self._kickstarted and self.rootpw.password: self.pw.set_placeholder_text(_("The password was set by kickstart.")) self.confirm.set_placeholder_text(_("The password was set by kickstart."))
@@ -79,7 +80,10 @@ class PasswordSpoke(FirstbootSpokeMixIn, NormalSpoke): if self._error: return _("Error setting root password") elif self._kickstarted: - return _("Root password was set by kickstart") + if self.data.rootpw.password: + return _("Root password was set by kickstart") + elif self.data.rootpw.lock: + return _("Root account was disabled by kickstart") elif self.data.rootpw.password: return _("Root password is set") elif self.data.rootpw.lock:
Some spokes need to have e.g. a different status when run in the Initial Setup.
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com --- pyanaconda/flags.py | 1 + 1 file changed, 1 insertion(+)
diff --git a/pyanaconda/flags.py b/pyanaconda/flags.py index 7a22c90..f519272 100644 --- a/pyanaconda/flags.py +++ b/pyanaconda/flags.py @@ -64,6 +64,7 @@ class Flags(object): self.imageInstall = False self.automatedInstall = False self.dirInstall = False + self.initialSetup = False self.askmethod = False self.eject = True self.extlinux = False
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com --- pyanaconda/ui/gui/spokes/password.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/password.py b/pyanaconda/ui/gui/spokes/password.py index 7cd6e49..0092448 100644 --- a/pyanaconda/ui/gui/spokes/password.py +++ b/pyanaconda/ui/gui/spokes/password.py @@ -24,6 +24,7 @@ from gi.repository import Gtk
from pyanaconda.i18n import _, N_ from pyanaconda.users import cryptPassword, validatePassword +from pyanaconda import flags from pwquality import PWQError
from pyanaconda.ui.gui.spokes import NormalSpoke @@ -59,9 +60,15 @@ class PasswordSpoke(FirstbootSpokeMixIn, NormalSpoke): self.confirm = self.builder.get_object("confirm")
self._kickstarted = self.data.rootpw.seen - if self._kickstarted and self.rootpw.password: - self.pw.set_placeholder_text(_("The password was set by kickstart.")) - self.confirm.set_placeholder_text(_("The password was set by kickstart.")) + if self.data.rootpw.password: + if self._in_initial_setup: + msg = _("The password was set in the installation.") + self.pw.set_placeholder_text(msg) + self.confirm.set_placeholder_text(msg) + elif self._kickstarted: + msg = _("The password was set by kickstart.") + self.pw.set_placeholder_text(msg) + self.confirm.set_placeholder_text(msg)
def refresh(self): # self.setCapsLockLabel() @@ -76,9 +83,18 @@ class PasswordSpoke(FirstbootSpokeMixIn, NormalSpoke): # self.capslock..set_text("")
@property + def _in_initial_setup(self): + return self._kickstarted and flags.flags.initialSetup + + @property def status(self): if self._error: return _("Error setting root password") + elif self._in_initial_setup: + if self.data.rootpw.password: + return _("Root password was set in the installation") + elif self.data.rootpw.lock: + return _("Root account was disabled in the installation") elif self._kickstarted: if self.data.rootpw.password: return _("Root password was set by kickstart")
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com --- initial_setup/__main__.py | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/initial_setup/__main__.py b/initial_setup/__main__.py index 9338f5e..809c77b 100644 --- a/initial_setup/__main__.py +++ b/initial_setup/__main__.py @@ -2,6 +2,10 @@ import os import sys import pykickstart + +from pyanaconda.flags import flags +flags.initialSetup = True + from pyanaconda.users import Users
if "DISPLAY" in os.environ and os.environ["DISPLAY"]:
On Tue, May 28, 2013 at 03:15:55PM +0200, Vratislav Podzimek wrote:
These patches are needed for the Initial Setup, together with one patch for its own code.
Vratislav Podzimek (3): Be more specific about what was set in the kickstart (#963970)
This one is ok.
Add flag indicating if running in the Initial Setup Refer to installation not kickstart in the Initial Setup (#963968)
I really don't like having to stuff in switches and conditional checks for initial setup. Anyone have any better ideas?
On Mon, 2013-06-03 at 13:31 -0700, Brian C. Lane wrote:
On Tue, May 28, 2013 at 03:15:55PM +0200, Vratislav Podzimek wrote:
These patches are needed for the Initial Setup, together with one patch for its own code.
Vratislav Podzimek (3): Be more specific about what was set in the kickstart (#963970)
This one is ok.
Add flag indicating if running in the Initial Setup Refer to installation not kickstart in the Initial Setup (#963968)
I really don't like having to stuff in switches and conditional checks for initial setup. Anyone have any better ideas?
I don't like it either, but we have switches and conditional checks also for many other cases and for the i-s, there won't be much of them. And if we stop referring to "kickstart" in status messages (I think "Root password is set" is equally good as "Root password was set by kickstart"), none such switch should be needed. Still at least the addons and some future code may need a flag indicating if the code is run as part of the i-s or not.
On Tue, Jun 04, 2013 at 01:07:24PM +0200, Vratislav Podzimek wrote:
On Mon, 2013-06-03 at 13:31 -0700, Brian C. Lane wrote:
On Tue, May 28, 2013 at 03:15:55PM +0200, Vratislav Podzimek wrote:
These patches are needed for the Initial Setup, together with one patch for its own code.
Vratislav Podzimek (3): Be more specific about what was set in the kickstart (#963970)
This one is ok.
Add flag indicating if running in the Initial Setup Refer to installation not kickstart in the Initial Setup (#963968)
I really don't like having to stuff in switches and conditional checks for initial setup. Anyone have any better ideas?
I don't like it either, but we have switches and conditional checks also for many other cases and for the i-s, there won't be much of them. And if we stop referring to "kickstart" in status messages (I think "Root password is set" is equally good as "Root password was set by kickstart"), none such switch should be needed. Still at least the addons and some future code may need a flag indicating if the code is run as part of the i-s or not.
I agree, more generic messages where appropriate are better than switches.
anaconda-patches@lists.fedorahosted.org