File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -108,8 +108,7 @@ def main():
108108 elif args .type in ( "cname_base" , "cname" , "graph" ):
109109 graph = Parser (gardenlinux_root , feature_dir_name ).filter (cname_base , additional_filter_func = additional_filter_func )
110110
111- sorted_features = Parser .sort_reversed_graph_nodes (graph )
112-
111+ sorted_features = Parser .sort_graph_nodes (graph )
113112 minimal_feature_set = get_minimal_feature_set (graph )
114113
115114 sorted_minimal_features = sort_subset (
Original file line number Diff line number Diff line change @@ -67,8 +67,7 @@ def main():
6767
6868 graph = Parser (gardenlinux_root , feature_dir_name ).filter (cname_base )
6969
70- sorted_features = Parser .sort_reversed_graph_nodes (graph )
71-
70+ sorted_features = Parser .sort_graph_nodes (graph )
7271 minimal_feature_set = get_minimal_feature_set (graph )
7372
7473 sorted_minimal_features = sort_subset (
Original file line number Diff line number Diff line change @@ -215,12 +215,16 @@ def _get_graph_node_type(node):
215215 return node .get ("content" , {}).get ("type" )
216216
217217 @staticmethod
218- def sort_reversed_graph_nodes (graph ):
218+ def sort_graph_nodes (graph ):
219219 def key_function (node ):
220220 prefix_map = {"platform" : "0" , "element" : "1" , "flag" : "2" }
221221 node_type = Parser ._get_graph_node_type (graph .nodes .get (node , {}))
222222 prefix = prefix_map [node_type ]
223223
224224 return f"{ prefix } -{ node } "
225225
226- return list (networkx .lexicographical_topological_sort (graph .reverse (), key = key_function ))
226+ return list (networkx .lexicographical_topological_sort (graph , key = key_function ))
227+
228+ @staticmethod
229+ def sort_reversed_graph_nodes (graph ):
230+ return Parser .sort_graph_nodes (graph .reverse ())
You can’t perform that action at this time.
0 commit comments