Skip to content

Commit 832e5a6

Browse files
committed
Allow empty flavor
1 parent 026fd47 commit 832e5a6

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/gardenlinux/features/__main__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,11 @@ def main() -> None:
118118

119119
additional_filter_func = lambda node: node not in args.ignore
120120

121-
if flavor is None or "":
122-
raise RuntimeError("Flavor could not be determined")
123-
124121
if args.type == "arch":
125122
print(arch)
126123
elif args.type in ("cname_base", "cname", "graph"):
127124
graph = Parser(gardenlinux_root, feature_dir_name).filter(
128-
flavor, additional_filter_func=additional_filter_func # type: ignore
125+
flavor, additional_filter_func=additional_filter_func
129126
)
130127

131128
sorted_features = Parser.sort_graph_nodes(graph)

src/gardenlinux/features/parser.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def graph(self) -> networkx.Graph:
117117

118118
def filter(
119119
self,
120-
cname: str,
120+
cname: str | None,
121121
ignore_excludes: bool = False,
122122
additional_filter_func: Optional[Callable[[str], bool]] = None,
123123
) -> networkx.Graph:
@@ -163,7 +163,7 @@ def filter(
163163

164164
def filter_as_dict(
165165
self,
166-
cname: str,
166+
cname: str | None,
167167
ignore_excludes: bool = False,
168168
additional_filter_func: Optional[Callable[[str], bool]] = None,
169169
) -> dict:
@@ -195,7 +195,7 @@ def filter_as_dict(
195195

196196
def filter_as_list(
197197
self,
198-
cname: str,
198+
cname: str | None,
199199
ignore_excludes: bool = False,
200200
additional_filter_func: Optional[Callable[[str], bool]] = None,
201201
) -> list:
@@ -215,7 +215,7 @@ def filter_as_list(
215215

216216
def filter_as_string(
217217
self,
218-
cname: str,
218+
cname: str | None,
219219
ignore_excludes: bool = False,
220220
additional_filter_func: Optional[Callable[[str], bool]] = None,
221221
) -> str:

0 commit comments

Comments
 (0)