aboutsummaryrefslogtreecommitdiffstats
path: root/onap-client
diff options
context:
space:
mode:
Diffstat (limited to 'onap-client')
-rw-r--r--onap-client/onap_client/sdc/service.py19
-rw-r--r--onap-client/setup.py2
2 files changed, 13 insertions, 8 deletions
diff --git a/onap-client/onap_client/sdc/service.py b/onap-client/onap_client/sdc/service.py
index 1bccb36..05ccbeb 100644
--- a/onap-client/onap_client/sdc/service.py
+++ b/onap-client/onap_client/sdc/service.py
@@ -402,13 +402,18 @@ def get_service_id(service_name, oc=None):
if not oc:
oc = Client()
- response = oc.sdc.service.get_service_by_name_version(
- catalog_service_name=service_name,
- catalog_service_version="1.0",
- raise_on_error=False,
- attempts=1,
- )
- if not response.success:
+ try:
+ response = oc.sdc.service.get_service_by_name_version(
+ catalog_service_name=service_name,
+ catalog_service_version="1.0",
+ attempts=1,
+ )
+ except Exception as e:
+ if str(e).lower().find("service was not found") != -1:
+ services = oc.sdc.service.get_services().response_data.get("services", [])
+ for service in services:
+ if service.get("name") == service_name:
+ return service.get("uniqueId"), service
return None, None
versions = response.response_data.get("allVersions")
diff --git a/onap-client/setup.py b/onap-client/setup.py
index 1b34a09..b849344 100644
--- a/onap-client/setup.py
+++ b/onap-client/setup.py
@@ -43,7 +43,7 @@ with open("README.md", "r") as fh:
setuptools.setup(
name="onap-client",
- version="1.5.4",
+ version="1.5.5",
author="Steven Stark",
author_email="steven.stark@att.com",
description="Python API wrapper for ONAP applications",