@@ -115,7 +115,7 @@ def create_pvc_pod(
115115 logger .info (f"code { api_exception .status } " )
116116 if api_exception .status == 404 :
117117 logger .info (
118- "pod not found, "
118+ "pvc not found, "
119119 "failed to build resources correctly"
120120 )
121121 return 43
@@ -313,7 +313,7 @@ def __enter__(self):
313313 return self
314314
315315 def __exit__ (self , exc_type , exc_value , traceback ):
316- if self .return_code != 4 :
316+ if self .return_code != 43 :
317317 self .clean ()
318318 if self .return_code == 0 :
319319 self .return_message = "all tests passed"
@@ -375,17 +375,20 @@ def main(argv):
375375 try :
376376 env .return_code = create_pvc_pod (k8s_core_api , default_class_name )
377377 logger .debug (f"create: { env .return_code } " )
378+ if env .return_code != 0 :
379+ env .return_message = "(404) resource not found"
380+ return
378381 except ApiException as api_exception :
379382 logger .info (f"code { api_exception .status } " )
380- if api_exception .status == 404 :
383+ if api_exception .status == 404 : # might be obsolete
381384 logger .info (
382385 "resource not found, "
383386 "failed to build resources correctly"
384387 )
385388 env .return_code = 4
386389 env .return_message = "(404) resource not found"
387390 return
388- elif api_exception .status == 409 :
391+ elif api_exception .status == 409 :# might be obsolete
389392 logger .info (
390393 "conflicting resources, "
391394 "try to clean up left overs, then start again"
0 commit comments