File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,12 +49,15 @@ def build_filter_from_args(args) -> Filter:
4949 Filter: A Filter object populated with relevant filter values.
5050 """
5151 filter_obj = Filter ()
52- if filter_on and filter_on in FILTER_DATA_CLASSES :
53- for arg in args :
54- if isinstance (arg , FILTER_DATA_CLASSES [filter_on ]):
55- filter_value = getattr (filter_obj , f"v{ arg .POLICY_POSITION } " )
56- filter_value .append (arg .policy_template ) # Used to load p type policies as well. E.g., lib^*
57- filter_value .append (arg .namespaced_key ) # E.g., lib^lib:DemoX:CSPROB
52+ if not filter_on or filter_on not in FILTER_DATA_CLASSES :
53+ return filter_obj
54+
55+ for arg in args :
56+ if isinstance (arg , FILTER_DATA_CLASSES [filter_on ]):
57+ filter_value = getattr (filter_obj , f"v{ arg .POLICY_POSITION } " )
58+ filter_value .append (arg .policy_template ) # Used to load p type policies as well. E.g., lib^*
59+ filter_value .append (arg .namespaced_key ) # E.g., lib^lib:DemoX:CSPROB
60+
5861 return filter_obj
5962
6063 def decorator (f ):
You can’t perform that action at this time.
0 commit comments