aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Cordero <gentoo.catalyst@0xdc.io>2022-04-21 07:08:23 +0000
committerMatt Turner <mattst88@gentoo.org>2022-05-13 13:41:47 -0400
commitae7d28b81ddc5285a210e927bec563065fda7f16 (patch)
tree76a06cedf27bf83b75f439aeb0c10f8efab9459a /catalyst
parentarch/mips: Compile mipsel3 stages with -mfix-r5900 (diff)
downloadcatalyst-ae7d28b81ddc5285a210e927bec563065fda7f16.tar.gz
catalyst-ae7d28b81ddc5285a210e927bec563065fda7f16.tar.bz2
catalyst-ae7d28b81ddc5285a210e927bec563065fda7f16.zip
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@0xdc.io> Signed-off-by: Matt Turner <mattst88@gentoo.org>
Diffstat (limited to 'catalyst')
-rw-r--r--catalyst/base/stagebase.py6
1 files 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"] = []