aboutsummaryrefslogtreecommitdiffstats
path: root/src/onaptests/steps/instantiate/service_ala_carte.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/service_ala_carte.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/service_ala_carte.py')
-rw-r--r--src/onaptests/steps/instantiate/service_ala_carte.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/onaptests/steps/instantiate/service_ala_carte.py b/src/onaptests/steps/instantiate/service_ala_carte.py
index d5e5096..6000e73 100644
--- a/src/onaptests/steps/instantiate/service_ala_carte.py
+++ b/src/onaptests/steps/instantiate/service_ala_carte.py
@@ -6,6 +6,7 @@ from onapsdk.aai.cloud_infrastructure import CloudRegion, Tenant
from onapsdk.aai.business import Customer, ServiceInstance, ServiceSubscription
from onapsdk.aai.business.owning_entity import OwningEntity as AaiOwningEntity
from onapsdk.configuration import settings
+from onapsdk.exceptions import ResourceNotFound
from onapsdk.sdc.service import Service
from onapsdk.so.instantiation import ServiceInstantiation
from onapsdk.vid import Project
@@ -66,7 +67,7 @@ class ServiceAlaCarteInstantiateStep(BaseStep):
try:
owning_entity = AaiOwningEntity.get_by_owning_entity_name(
settings.OWNING_ENTITY)
- except ValueError:
+ except ResourceNotFound:
self._logger.info("Owning entity not found, create it")
owning_entity = AaiOwningEntity.create(settings.OWNING_ENTITY)
vid_project = Project.create(settings.PROJECT)
@@ -187,7 +188,7 @@ class YamlTemplateServiceAlaCarteInstantiateStep(YamlTemplateBaseStep):
try:
owning_entity = AaiOwningEntity.get_by_owning_entity_name(
settings.OWNING_ENTITY)
- except ValueError:
+ except ResourceNotFound:
self._logger.info("Owning entity not found, create it")
owning_entity = AaiOwningEntity.create(settings.OWNING_ENTITY)
vid_project = Project.create(settings.PROJECT)