File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -741,16 +741,22 @@ def __deepcopy__(self, memo):
741741 return result
742742
743743 @staticmethod
744- def _convert_platform_names (env_yaml , rule , product_cpes ):
744+ def _has_platforms_to_convert (env_yaml , rule , product_cpes ):
745745 # Convert the platform names to CPE names
746746 # But only do it if an env_yaml was specified (otherwise there would
747747 # be no product CPEs to lookup), and the rule's prodtype matches the
748748 # product being built also if the rule already has cpe_platform_names
749749 # specified (compiled rule) do not evaluate platforms again
750- if (not env_yaml or
751- (env_yaml ["product" ] not in parse_prodtype (rule .prodtype )
752- and rule .prodtype != "all" ) or
753- (not product_cpes or rule .cpe_platform_names )):
750+ return (
751+ env_yaml and
752+ (env_yaml ["product" ] in parse_prodtype (rule .prodtype ) or
753+ rule .prodtype == "all" ) and
754+ (product_cpes and not rule .cpe_platform_names )
755+ )
756+
757+ @staticmethod
758+ def _convert_platform_names (env_yaml , rule , product_cpes ):
759+ if not Rule ._has_platforms_to_convert (env_yaml , rule , product_cpes ):
754760 return
755761 # parse platform definition and get CPEAL platform
756762 for platform in rule .platforms :
You can’t perform that action at this time.
0 commit comments