aboutsummaryrefslogtreecommitdiffstats
path: root/src/onaptests/steps/instantiate/k8s_profile_create.py
diff options
context:
space:
mode:
authorMichal Jagiello <michal.jagiello@t-mobile.pl>2021-02-05 20:37:02 +0000
committermorganrol <morgan.richomme@orange.com>2021-02-08 18:12:38 +0100
commitdf5a03610d6f00ed8e8ee3e153de055fbc5dae94 (patch)
tree252a682d3932edd33301861c604abefb2191d8cd /src/onaptests/steps/instantiate/k8s_profile_create.py
parent5021508f4b6f8bf2bb6ef890b4bb960dc144484b (diff)
Python SDK 7.4.0 compatibility
Use Python SDK exceptions. Issue-ID: TEST-302 Signed-off-by: Michal Jagiello <michal.jagiello@t-mobile.pl> Change-Id: I76996817c0d7b91c0214ad521c3768682ff07e83
Diffstat (limited to 'src/onaptests/steps/instantiate/k8s_profile_create.py')
-rw-r--r--src/onaptests/steps/instantiate/k8s_profile_create.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/onaptests/steps/instantiate/k8s_profile_create.py b/src/onaptests/steps/instantiate/k8s_profile_create.py
index a875f11..c2692c8 100644
--- a/src/onaptests/steps/instantiate/k8s_profile_create.py
+++ b/src/onaptests/steps/instantiate/k8s_profile_create.py
@@ -4,6 +4,7 @@ from yaml import load
from onapsdk.aai.business import Customer, ServiceInstance, ServiceSubscription
from onapsdk.configuration import settings
+from onapsdk.exceptions import APIError, ResourceNotFound
from onapsdk.msb.k8s import Definition
from onapsdk.so.instantiation import VnfParameter
@@ -142,7 +143,7 @@ class K8SProfileStep(BaseStep):
######## Check profile for Definition ###################################
try:
rbdef.get_profile_by_name(k8s_profile_name)
- except ValueError:
+ except ResourceNotFound:
######## Create profile for Definition ###################################
profile = rbdef.create_profile(k8s_profile_name,
k8s_profile_namespace,
@@ -174,7 +175,7 @@ class K8SProfileStep(BaseStep):
try:
profile = rbdef.get_profile_by_name(k8s_profile_name)
profile.delete()
- except ValueError:
+ except APIError:
self._logger.error("K8s profile deletion %s failed", k8s_profile_name)
raise onap_test_exceptions.ProfileCleanupException
super().cleanup()