qubes-installer-qubes-os/anaconda/0034-anaconda-Make-sure-that-a-user-is-created-at-install.patch
2018-10-21 12:54:49 +02:00

95 lines
3.7 KiB
Diff

From b93178bff8ecb1e362c79e845c2e7ceec08c682e Mon Sep 17 00:00:00 2001
From: "M. Vefa Bicakci" <m.v.b@runbox.com>
Date: Fri, 19 Oct 2018 08:02:12 +0200
Subject: [PATCH] anaconda: Make sure that a user is created at installation
time
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Frédéric Pierret <frederic.epitre@orange.fr>
---
pyanaconda/ui/gui/spokes/user.py | 8 ++------
pyanaconda/ui/tui/spokes/user.py | 10 +++-------
2 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/user.py b/pyanaconda/ui/gui/spokes/user.py
index dac6ba3e5..dd281f8e4 100644
--- a/pyanaconda/ui/gui/spokes/user.py
+++ b/pyanaconda/ui/gui/spokes/user.py
@@ -26,7 +26,6 @@ from pyanaconda.users import cryptPassword, validatePassword, guess_username, ch
from pyanaconda.ui.gui.spokes import NormalSpoke
from pyanaconda.ui.gui import GUIObject
from pyanaconda.ui.categories.user_settings import UserSettingsCategory
-from pyanaconda.ui.common import FirstbootSpokeMixIn
from pyanaconda.ui.helpers import InputCheck
from pyanaconda.ui.gui.helpers import GUISpokeInputCheckHandler, GUIDialogInputCheckHandler
from pyanaconda.ui.gui.utils import blockedHandler, set_password_visibility
@@ -206,7 +205,7 @@ class AdvancedUserDialog(GUIObject, GUIDialogInputCheckHandler):
return False
-class UserSpoke(FirstbootSpokeMixIn, NormalSpoke, GUISpokeInputCheckHandler):
+class UserSpoke(NormalSpoke, GUISpokeInputCheckHandler):
"""
.. inheritance-diagram:: UserSpoke
:parts: 3
@@ -348,10 +347,7 @@ class UserSpoke(FirstbootSpokeMixIn, NormalSpoke, GUISpokeInputCheckHandler):
@property
def mandatory(self):
- """ Only mandatory if the root pw hasn't been set in the UI
- eg. not mandatory if the root account was locked in a kickstart
- """
- return not self.data.rootpw.password and not self.data.rootpw.lock
+ return True
def apply(self):
# set the password only if the user enters anything to the text entry
diff --git a/pyanaconda/ui/tui/spokes/user.py b/pyanaconda/ui/tui/spokes/user.py
index 834b82cbf..baa3ac203 100644
--- a/pyanaconda/ui/tui/spokes/user.py
+++ b/pyanaconda/ui/tui/spokes/user.py
@@ -20,7 +20,6 @@
from pyanaconda.ui.categories.user_settings import UserSettingsCategory
from pyanaconda.ui.tui.spokes import EditTUISpoke
from pyanaconda.ui.tui.spokes import EditTUISpokeEntry as Entry
-from pyanaconda.ui.common import FirstbootSpokeMixIn
from pyanaconda.users import guess_username, check_username
from pyanaconda.flags import flags
from pyanaconda.i18n import N_, _
@@ -30,7 +29,7 @@ from pyanaconda.regexes import GECOS_VALID, GROUPLIST_SIMPLE_VALID
__all__ = ["UserSpoke"]
-class UserSpoke(FirstbootSpokeMixIn, EditTUISpoke):
+class UserSpoke(EditTUISpoke):
"""
.. inheritance-diagram:: UserSpoke
:parts: 3
@@ -64,8 +63,8 @@ class UserSpoke(FirstbootSpokeMixIn, EditTUISpoke):
return False
def __init__(self, app, data, storage, payload, instclass):
- FirstbootSpokeMixIn.__init__(self)
EditTUISpoke.__init__(self, app, data, storage, payload, instclass, "user")
+
if self.data.user.userList:
self.args = self.data.user.userList[0]
self.args._create = True
@@ -108,10 +107,7 @@ class UserSpoke(FirstbootSpokeMixIn, EditTUISpoke):
@property
def mandatory(self):
- """ Only mandatory if the root pw hasn't been set in the UI
- eg. not mandatory if the root account was locked in a kickstart
- """
- return not self.data.rootpw.password and not self.data.rootpw.lock
+ return True
@property
def status(self):
--
2.14.4