From b2985817691c366567e5cdcf93339f33f32f135c Mon Sep 17 00:00:00 2001 From: Eviatar Gerzi Date: Fri, 23 Jun 2023 01:01:15 +0300 Subject: [PATCH] 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 --- KubiScan.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/KubiScan.py b/KubiScan.py index d92cc93..451a548 100755 --- a/KubiScan.py +++ b/KubiScan.py @@ -102,16 +102,12 @@ def get_all_affecting_cves_table_by_version(current_k8s_version): return cve_table def get_cve_color(cve_severity): - match cve_severity: - case "Low": - return WHITE - case "Medium": - return LIGHTYELLOW - case "High": - return RED - case "Critical": - return RED - + if cve_severity == "Low": + return WHITE + elif cve_severity == "Medium": + return LIGHTYELLOW + elif cve_severity == "High" or cve_severity == "Critical": + return RED def get_fixed_versions_of_cve(cve_fixed_versions): fixed_version_list = ""