Skip to content

Commit 2c7524f

Browse files
committed
check for dir back
Signed-off-by: Katharina Trentau <[email protected]>
1 parent 4961361 commit 2c7524f

File tree

1 file changed

+4
-0
lines changed
  • Tests/kaas/k8s-default-storage-class

1 file changed

+4
-0
lines changed

Tests/kaas/k8s-default-storage-class/helper.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import sys
33
import logging
44
from kubernetes import client, config
5+
import os
56

67
manual_result_file_template = {
78
"name": None,
@@ -70,5 +71,8 @@ def gen_sonobuoy_result_file(error_n: int, error_msg: str, test_file_name: str):
7071
result_file["status"] = test_status
7172
result_file["details"]["messages"] = error_msg
7273

74+
directory_path = os.path.dirname(f"./{test_name}.result.yaml")
75+
os.makedirs(directory_path, exist_ok=True)
76+
7377
with open(f"./{test_name}.result.yaml", "w") as file:
7478
yaml.dump(result_file, file)

0 commit comments

Comments
 (0)