fix(windows-path): --list-services bad split (#2028)

Co-authored-by: Sergio Garcia <sergargar1@gmail.com>
This commit is contained in:
Gary Mclean
2023-03-06 13:00:07 +00:00
committed by GitHub
parent ef8831f784
commit c45dd47d34

View File

@@ -122,7 +122,10 @@ def list_services(provider: str) -> set():
checks_tuple = recover_checks_from_provider(provider)
for _, check_path in checks_tuple:
# Format: /absolute_path/prowler/providers/{provider}/services/{service_name}/{check_name}
service_name = check_path.split("/")[-2]
if os.name == "nt":
service_name = check_path.split("\\")[-2]
else:
service_name = check_path.split("/")[-2]
available_services.add(service_name)
return sorted(available_services)