aboutsummaryrefslogtreecommitdiffstats
path: root/test/security
diff options
context:
space:
mode:
authormrichomme <morgan.richomme@orange.com>2021-01-18 10:08:30 +0100
committermrichomme <morgan.richomme@orange.com>2021-01-18 10:08:30 +0100
commita9ee3248101eef2287315d300fbb7c5e36d0670e (patch)
tree5d25a3a6bbddef05ffa5527b26dbe9d3041355e1 /test/security
parent2c2326a13c9867ec1cbf0e64e127ff28c7149404 (diff)
Fix version test in CI
Issue-ID: INT-1834 Signed-off-by: mrichomme <morgan.richomme@orange.com> Change-Id: I032ad1234036c5671722456995d1059a8a493cfb
Diffstat (limited to 'test/security')
-rw-r--r--test/security/check_versions/src/k8s_bin_versions_inspector.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/test/security/check_versions/src/k8s_bin_versions_inspector.py b/test/security/check_versions/src/k8s_bin_versions_inspector.py
index e5a59b923..d576dd767 100644
--- a/test/security/check_versions/src/k8s_bin_versions_inspector.py
+++ b/test/security/check_versions/src/k8s_bin_versions_inspector.py
@@ -305,13 +305,17 @@ def sync_post_namespaced_pod_exec(
# TODO: Is there really no better way, to check
# execution exit code in python k8s API client?
- code = (
- 0
- if error["status"] == "Success"
- else -2
- if error["reason"] != "NonZeroExitCode"
- else int(error["details"]["causes"][0]["message"])
- )
+ code=-2
+ try:
+ code = (
+ 0
+ if error["status"] == "Success"
+ else -2
+ if error["reason"] != "NonZeroExitCode"
+ else int(error["details"]["causes"][0]["message"])
+ )
+ except:
+ pass
return {
"stdout": stdout,