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 CC0B115808D for ; Thu, 21 Apr 2022 07:08:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 02DD6E0823; Thu, 21 Apr 2022 07:08:43 +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 A2D67E0823 for ; Thu, 21 Apr 2022 07:08:42 +0000 (UTC) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=0xdc.io; q=dns/txt; s=smtp; t=1650524922; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-Id: Date: Subject: Subject: To: To: From: From: Sender: Sender; bh=eGYP0x4vUJFSv3spimRsf4heI9QgZr1s+ycAO49iJxc=; b=o5CpkJsm4bM9iI+aCvgPxok+ysT/ekaYeTqd0qYH+YeIN3M5vhk4JcX87Rap0IsD7oUOLnEP so6wKWAf+ymjRZN/Ukwy4wScz8p7FbuxDTdJlZMQTIfmHD4uVZNx3HL3aY2/OaazKNmm4afi nc1xuoPfdOA+Za7vuNn/GD1MJq0= X-Mailgun-Sending-Ip: 209.61.151.234 X-Mailgun-Sid: WyJiZmIxMyIsICJnZW50b28tY2F0YWx5c3RAbGlzdHMuZ2VudG9vLm9yZyIsICJmNjc0NGUiXQ== Received: from mail.0xdc.io (mail.0xdc.io [54.37.0.172]) by smtp-out-n03.prod.us-east-1.postgun.com with SMTP id 626102f96519c03956de22ac (version=TLS1.3, cipher=TLS_AES_128_GCM_SHA256); Thu, 21 Apr 2022 07:08:41 GMT Sender: gentoo.catalyst@0xdc.io 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 E48BD102418 for ; Thu, 21 Apr 2022 07:10:30 +0000 (UTC) From: Daniel Cordero To: gentoo-catalyst@lists.gentoo.org Subject: [gentoo-catalyst] [PATCH 1/4] stage4: fix handling of groups, users and keys Date: Thu, 21 Apr 2022 07:08:23 +0000 Message-Id: <20220421070826.92638-1-gentoo.catalyst@0xdc.io> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: 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-Transfer-Encoding: 8bit X-Archives-Salt: 9851a4e3-fb80-433a-acb5-31203dab3a3d X-Archives-Hash: 9d18f56b68edbe1e43a4c77d00bc8557 Previously, the set_*() functions would always set the result of the toml parsing as the setting. Instead, only override it if it is a string. This fixes an issue introduced in commit 5be6069bcbd5a7fa3f114f28366597bc5ddbb891. --- catalyst/base/stagebase.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 5c7e9adb..1d71c59d 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -589,9 +589,9 @@ class StageBase(TargetBase, ClearBase, GenBase): def set_groups(self): groups = self.settings["spec_prefix"] + "/groups" if groups in self.settings: + self.settings["groups"] = self.settings[groups] 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"] = [] @@ -600,9 +600,9 @@ class StageBase(TargetBase, ClearBase, GenBase): def set_users(self): users = self.settings["spec_prefix"] + "/users" if users in self.settings: + self.settings["users"] = self.settings[users] 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"] = [] @@ -611,9 +611,9 @@ class StageBase(TargetBase, ClearBase, GenBase): def set_ssh_public_keys(self): ssh_public_keys = self.settings["spec_prefix"] + "/ssh_public_keys" if ssh_public_keys in self.settings: + self.settings["ssh_public_keys"] = self.settings[ssh_public_keys] if isinstance(self.settings[ssh_public_keys], str): self.settings["ssh_public_keys"] = self.settings[ssh_public_keys].split(",") - self.settings["ssh_public_keys"] = self.settings[ssh_public_keys] del self.settings[ssh_public_keys] else: self.settings["ssh_public_keys"] = [] -- 2.35.1