From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1395891-garchives=archives.gentoo.org@lists.gentoo.org>
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 491DC158090
	for <garchives@archives.gentoo.org>; Fri, 13 May 2022 17:43:50 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 5A407E0894;
	Fri, 13 May 2022 17:43:49 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 453E7E0894
	for <gentoo-commits@lists.gentoo.org>; Fri, 13 May 2022 17:43:49 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 86490341A70
	for <gentoo-commits@lists.gentoo.org>; Fri, 13 May 2022 17:43:47 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id D87D2445
	for <gentoo-commits@lists.gentoo.org>; Fri, 13 May 2022 17:43:45 +0000 (UTC)
From: "Matt Turner" <mattst88@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Matt Turner" <mattst88@gentoo.org>
Message-ID: <1652463707.ae7d28b81ddc5285a210e927bec563065fda7f16.mattst88@gentoo>
Subject: [gentoo-commits] proj/catalyst:stage4-user-groups-fixes commit in: catalyst/base/
X-VCS-Repository: proj/catalyst
X-VCS-Files: catalyst/base/stagebase.py
X-VCS-Directories: catalyst/base/
X-VCS-Committer: mattst88
X-VCS-Committer-Name: Matt Turner
X-VCS-Revision: ae7d28b81ddc5285a210e927bec563065fda7f16
X-VCS-Branch: stage4-user-groups-fixes
Date: Fri, 13 May 2022 17:43:45 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 62394e24-db60-4aa4-86ab-f2ebc86451d2
X-Archives-Hash: 9f0836f2c14ba4aeab4e80b48f4f2e1b
Message-ID: <20220513174345.7qit-2kjKkB7-q8bsYfYNpuyXm2hjDw7JrcJCj5s_Sc@z>

commit:     ae7d28b81ddc5285a210e927bec563065fda7f16
Author:     Daniel Cordero <gentoo.catalyst <AT> 0xdc <DOT> io>
AuthorDate: Thu Apr 21 07:08:23 2022 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Fri May 13 17:41:47 2022 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=ae7d28b8

catalyst/stage4: fix handling of groups, users and keys

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.

Fixes: 5be6069b ("catalyst: support 3 new options")
Signed-off-by: Daniel Cordero <gentoo.catalyst <AT> 0xdc.io>
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 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"] = []