aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gentoo.org>2020-04-11 15:23:54 -0700
committerMatt Turner <mattst88@gentoo.org>2020-04-13 13:43:10 -0700
commitdd9e1cda4772f33fa0c3d07578c5ca6808c6dd22 (patch)
tree1ed02726477532fda8cbe829ffcaf5857843726a /catalyst/targets/netboot.py
parentcatalyst: Fix appending --b2sum (diff)
downloadcatalyst-dd9e1cda4772f33fa0c3d07578c5ca6808c6dd22.tar.gz
catalyst-dd9e1cda4772f33fa0c3d07578c5ca6808c6dd22.tar.bz2
catalyst-dd9e1cda4772f33fa0c3d07578c5ca6808c6dd22.zip
catalyst: Clean assignments of {valid/required}_values
Making them class variables will allow us to verify that all subclasses of TargetBase have defined them (in the next commit). While we're moving them, change them to frozensets, since testing membership is the thing they're useed for. Signed-off-by: Matt Turner <mattst88@gentoo.org>
Diffstat (limited to 'catalyst/targets/netboot.py')
-rw-r--r--catalyst/targets/netboot.py29
1 files changed, 14 insertions, 15 deletions
diff --git a/catalyst/targets/netboot.py b/catalyst/targets/netboot.py
index 675a6f79..95fe3368 100644
--- a/catalyst/targets/netboot.py
+++ b/catalyst/targets/netboot.py
@@ -16,21 +16,20 @@ class netboot(StageBase):
"""
Builder class for a netboot build, version 2
"""
- def __init__(self,spec,addlargs):
- self.required_values=[
- "boot/kernel"
- ]
- self.valid_values=self.required_values[:]
- self.valid_values.extend([
- "netboot/packages",
- "netboot/use",
- "netboot/extra_files",
- "netboot/overlay",
- "netboot/busybox_config",
- "netboot/root_overlay",
- "netboot/linuxrc"
- ])
+ required_values = frozenset([
+ "boot/kernel",
+ ])
+ valid_values = required_values | frozenset([
+ "netboot/busybox_config",
+ "netboot/extra_files",
+ "netboot/linuxrc",
+ "netboot/overlay",
+ "netboot/packages",
+ "netboot/root_overlay",
+ "netboot/use",
+ ])
+ def __init__(self,spec,addlargs):
try:
if "netboot/packages" in addlargs:
if isinstance(addlargs['netboot/packages'], str):
@@ -39,7 +38,7 @@ class netboot(StageBase):
loopy=addlargs["netboot/packages"]
for x in loopy:
- self.valid_values.append("netboot/packages/"+x+"/files")
+ self.valid_values |= {"netboot/packages/"+x+"/files"}
except:
raise CatalystError("configuration error in netboot/packages.")