Skip to content

Commit b298581

Browse files
authored
Added support to match case (Fix #69)
match case only support from Python 3.10, I changed it to if else so it will support any other versions
1 parent b851b37 commit b298581

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

KubiScan.py

+6-10
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,12 @@ def get_all_affecting_cves_table_by_version(current_k8s_version):
102102
return cve_table
103103

104104
def get_cve_color(cve_severity):
105-
match cve_severity:
106-
case "Low":
107-
return WHITE
108-
case "Medium":
109-
return LIGHTYELLOW
110-
case "High":
111-
return RED
112-
case "Critical":
113-
return RED
114-
105+
if cve_severity == "Low":
106+
return WHITE
107+
elif cve_severity == "Medium":
108+
return LIGHTYELLOW
109+
elif cve_severity == "High" or cve_severity == "Critical":
110+
return RED
115111

116112
def get_fixed_versions_of_cve(cve_fixed_versions):
117113
fixed_version_list = ""

0 commit comments

Comments
 (0)