Gentoo Archives: gentoo-catalyst

From: Daniel Cordero <gentoo.catalyst@××××.io>
To: gentoo-catalyst@l.g.o
Subject: [gentoo-catalyst] [PATCH v2 4/4] stage4/users: improve log message
Date: Mon, 09 May 2022 11:21:26
Message-Id: 20220509112047.2422391-1-gentoo.catalyst@0xdc.io
In Reply to: [gentoo-catalyst] [PATCH 4/4] stage4/groups: improve log message by Daniel Cordero
1 When creating a user with no additional groups, don't print a misleading
2 message saying the user will be created with an equals sign in the
3 username.
4 ---
5 catalyst/base/stagebase.py | 4 +++-
6 1 file changed, 3 insertions(+), 1 deletion(-)
7
8 diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
9 index d4875491..eb869c70 100644
10 --- a/catalyst/base/stagebase.py
11 +++ b/catalyst/base/stagebase.py
12 @@ -945,9 +945,11 @@ class StageBase(TargetBase, ClearBase, GenBase):
13 log.debug("users: '=' separator not found on line " + x)
14 log.debug("users: missing separator means no groups found")
15 uacmd = ["useradd", "-R", self.settings['chroot_path'], "-m", x]
16 + msg_create_user = "Creating user: '%s'" % usr
17 if grp != '':
18 uacmd = ["useradd", "-R", self.settings['chroot_path'], "-m", "-G", grp, usr]
19 - log.notice("Creating user: '%s'", f"{usr}={grp}")
20 + msg_create_user = "Creating user: '%s' in group(s): %s" % usr, grp
21 + log.notice(msg_create_user)
22 cmd(uacmd, env=self.env)
23
24 def ssh_public_keys(self):
25 --
26 2.35.1