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 2FEA615808D for ; Wed, 20 Apr 2022 23:26:13 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 25079E086A; Wed, 20 Apr 2022 23:26:12 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 02875E086A for ; Wed, 20 Apr 2022 23:26:12 +0000 (UTC) Received: by mail-ej1-f52.google.com with SMTP id ks6so6636538ejb.1 for ; Wed, 20 Apr 2022 16:26:10 -0700 (PDT) X-Gm-Message-State: AOAM531mDniSsK4xmpwkkLNVphpwCGlY9BU1i/xRJEY9EdNIK0NaoOxm HJXf1o50xCWlSSkop+9PoqvSKE/MlSeKhTiTBUs= X-Google-Smtp-Source: ABdhPJyAPqMWz6qcof5LKmXPzkWSwlePIvbVYZnt1oKd70zCdBexbEqxXQvgwybe7ErunNhts2/yfG4l1KDJxH0cd/A= X-Received: by 2002:a17:907:7815:b0:6ce:5242:1280 with SMTP id la21-20020a170907781500b006ce52421280mr20682834ejc.217.1650497168299; Wed, 20 Apr 2022 16:26:08 -0700 (PDT) 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 References: <20220327233712.1282001-1-mattst88@gentoo.org> In-Reply-To: From: Matt Turner Date: Wed, 20 Apr 2022 16:25:56 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [gentoo-catalyst] [PATCH 1/3] catalyst: support 3 new options To: gentoo-catalyst@lists.gentoo.org Cc: Patrice Clement Content-Type: text/plain; charset="UTF-8" X-Archives-Salt: a2fddd9e-092f-4e00-b074-e43d251dcaa7 X-Archives-Hash: 80adb29572286cbf759535e56c4493f9 On Tue, Apr 19, 2022 at 7:17 AM Daniel Cordero wrote: > > 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 Thanks, fixed.