From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id ED44015808D for ; Tue, 19 Apr 2022 14:17:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BAEE5E07DB; Tue, 19 Apr 2022 14:17:53 +0000 (UTC) Received: from rs234.mailgun.us (rs234.mailgun.us [209.61.151.234]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CD922E07DB for ; Tue, 19 Apr 2022 14:17:52 +0000 (UTC) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=xxoo.ws; q=dns/txt; s=mx; t=1650377872; h=In-Reply-To: Content-Type: MIME-Version: References: Message-ID: Subject: Subject: Cc: To: To: From: From: Date: Sender: Sender; bh=LvIMEsdLkjo15Jv3s27GzO9g3Nad3rIvUSykdEtst+A=; b=Bw8el6tA+6t5J8MWcPuHrrmPQYP8TpnFVIYsv0iwJnigN7lDMxYdP3FsnB/axwsUGLRoEOxk ZmrJqzL1NhxH2OeNEu9GyQNK3MJ6hhguri1y0A/CaPugfIfkmkkOsTEC9sindAlsoOh63vo+ 7c94yhjKGyrw2QaXOIpRI2UdfKo= X-Mailgun-Sending-Ip: 209.61.151.234 X-Mailgun-Sid: WyIxYmU3MyIsICJnZW50b28tY2F0YWx5c3RAbGlzdHMuZ2VudG9vLm9yZyIsICJlYTQwNTYiXQ== Received: from mail.0xdc.io (mail.0xdc.io [54.37.0.172]) by smtp-out-n04.prod.us-east-1.postgun.com with SMTP id 625ec48e38a4f8e57d3d5cba (version=TLS1.3, cipher=TLS_AES_128_GCM_SHA256); Tue, 19 Apr 2022 14:17:50 GMT Sender: gentoo.catalyst@xxoo.ws Received: from pulsar (5.b.0.d.c.4.e.f.f.f.1.0.5.8.8.4.0.a.4.7.9.0.c.0.0.b.8.0.1.0.0.2.ip6.arpa [IPv6:2001:8b0:c09:74a0:4885:1ff:fe4c:d0b5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.0xdc.io (Postfix) with ESMTPSA id A6D9D1023FC; Tue, 19 Apr 2022 14:19:39 +0000 (UTC) Date: Tue, 19 Apr 2022 14:17:47 +0000 From: Daniel Cordero To: gentoo-catalyst@lists.gentoo.org Cc: Patrice Clement , Matt Turner Subject: Re: [gentoo-catalyst] [PATCH 1/3] catalyst: support 3 new options Message-ID: References: <20220327233712.1282001-1-mattst88@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220327233712.1282001-1-mattst88@gentoo.org> X-Archives-Salt: 8da464b0-eeb9-43f6-b5c7-ad2f5bc3e72f X-Archives-Hash: f4420bb42e7c970d1444f97266bc5019 On Sun, Mar 27, 2022 at 04:37:10PM -0700, Matt Turner wrote: > From: Patrice Clement > > * stage4/groups: create a a list of groups. > * stage4/users: create a list of users. users can also be added to > groups using the "foo.bar=wheel,audio,baz" format. > * stage4/ssh_public_keys: copy an SSH public key into the stage4 user's home > (.ssh/authorized_keys) and set the file permission to 0644. > > Bug: https://bugs.gentoo.org/236905 > --- > catalyst/base/stagebase.py | 70 ++++++++++++++++++++++++++++++++++++++ > 1 file changed, 70 insertions(+) > > diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py > index de1e30ef..76feb5f0 100644 > --- a/catalyst/base/stagebase.py > +++ b/catalyst/base/stagebase.py > @@ -201,6 +201,9 @@ class StageBase(TargetBase, ClearBase, GenBase): > self.set_packages() > self.set_rm() > self.set_linuxrc() > + self.set_groups() > + self.set_users() > + self.set_ssh_public_keys() > self.set_busybox_config() > self.set_overlay() > self.set_repos() > @@ -583,6 +586,39 @@ class StageBase(TargetBase, ClearBase, GenBase): > self.settings[self.settings["spec_prefix"] + "/linuxrc"] > del self.settings[self.settings["spec_prefix"] + "/linuxrc"] > > + def set_groups(self): > + groups = self.settings["spec_prefix"] + "/groups" > + if groups in self.settings: > + if isinstance(self.settings[groups], str): > + self.settings["groups"] = self.settings[groups].split(",") > + self.settings["groups"] = self.settings[groups] > + del self.settings[groups] > + else: > + self.settings["groups"] = [] > + log.info('groups to create: %s' % self.settings["groups"]) > + > + def set_users(self): Traceback (most recent call last): ... File "/catalyst/base/stagebase.py", line 600 def set_users(self): TabError: inconsistent use of tabs and spaces in indentation > + users = self.settings["spec_prefix"] + "/users" > + if users in self.settings: > + if isinstance(self.settings[users], str): > + self.settings["users"] = self.settings[users].split(",") > + self.settings["users"] = self.settings[users] > + del self.settings[users] > + else: > + self.settings["users"] = [] > + log.info('users to create: %s' % self.settings["users"]) > +