Skip to content

Commit e98f92d

Browse files
committed
dividing 404
Signed-off-by: Katharina Trentau <[email protected]>
1 parent 898825c commit e98f92d

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

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

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ def check_default_storageclass(k8s_client_storage):
6464
for item in storageclasses["items"]
6565
if item["metadata"]["annotations"].get(
6666
"storageclass.kubernetes.io/is-default-class"
67-
) == "true"
67+
)
68+
== "true"
6869
]
6970
if len(defaults) != 1:
7071
names = ", ".join(item[0] for item in defaults)
@@ -395,27 +396,26 @@ def main(argv):
395396
env.return_message = "(404) resource not found"
396397
return
397398
except ApiException as api_exception:
398-
# logger.info(f"code {api_exception.status}")
399-
# if api_exception.status == 404: # might be obsolete
400-
# logger.info(
401-
# "resource not found, "
402-
# "failed to build resources correctly"
403-
# )
404-
# env.return_code = 4
405-
# env.return_message = "(404) resource not found"
406-
# return
407-
# elif api_exception.status == 409:# might be obsolete
408-
# logger.info(
409-
# "conflicting resources, "
410-
# "try to clean up left overs, then start again"
411-
# )
412-
# env.return_code = 3
413-
# env.return_message = "(409) conflicting resources"
414-
# return
415-
# else:
416-
logger.info(f"An API error occurred: {api_exception}")
417-
env.return_code = api_exception.status
418-
return
399+
logger.info(f"code {api_exception.status}")
400+
if api_exception.status == 409: # might be obsolete
401+
logger.info(
402+
"conflicting resources, "
403+
"try to clean up left overs, then start again"
404+
)
405+
env.return_code = 3
406+
env.return_message = "(409) conflicting resources"
407+
return
408+
elif api_exception.status == 404: # might be obsolete
409+
logger.info(
410+
"resource not found, " "failed to build resources correctly"
411+
)
412+
env.return_code = 4
413+
env.return_message = "(404) resource not found"
414+
return
415+
else:
416+
logger.info(f"An API error occurred: {api_exception}")
417+
env.return_code = api_exception.status
418+
return
419419

420420
logger.info(
421421
"Check if default_persistent volume has ReadWriteOnce defined (MANDATORY)"

0 commit comments

Comments
 (0)