diff options
author | Sylvain Desbureaux <sylvain.desbureaux@orange.com> | 2021-02-08 17:24:58 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-02-08 17:24:58 +0000 |
commit | 1a5df3ce215a5502ff8e1045915e598ffada41c6 (patch) | |
tree | 284aaddcd73b8a5926289c3e0f072a8ffb0b13f5 /src/onaptests/steps/instantiate/k8s_profile_create.py | |
parent | ba1faac52b28f752516ab075a5bda56058548e49 (diff) | |
parent | df5a03610d6f00ed8e8ee3e153de055fbc5dae94 (diff) |
Merge "Python SDK 7.4.0 compatibility"
Diffstat (limited to 'src/onaptests/steps/instantiate/k8s_profile_create.py')
-rw-r--r-- | src/onaptests/steps/instantiate/k8s_profile_create.py | 5 |
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() |