On Tue, Apr 19, 2022 at 8:23 AM Daniel Cordero <gentoo.catal...@xxoo.ws> 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 > > @@ -894,6 +930,40 @@ class StageBase(TargetBase, ClearBase, GenBase): > > cmd(['rsync', '-a', x + '/', > > self.settings['stage_path']], > > env=self.env) > > > > + def groups(self): > > + for x in self.settings["groups"].split(): > > For users() and ssh_public_keys() the setting is used as-is, but for > groups it is .split(). > > None of them handle 0/1/2+ length settings as they get converted into lists > and strings. > > These need to be able to handle both cases.
Would you like to send a patch? (Or Patrice?)