diff options
author | stark, steven <steven.stark@att.com> | 2021-08-09 14:33:22 -0700 |
---|---|---|
committer | stark, steven <steven.stark@att.com> | 2021-08-09 14:39:37 -0700 |
commit | e330184a81a453780deca68afd6e764c0eb00109 (patch) | |
tree | a02a75431bb652fc50f326fd73ae32a538749968 | |
parent | 76a0639fc26652c9ed8ba5e573b16c2495313e47 (diff) |
[VVP] suport for service version <1.0istanbul
Issue-ID: VVP-556
Signed-off-by: stark, steven <steven.stark@att.com>
Change-Id: Ibce73608fe73d241cb6038ab4efa1fe00e5dbac0
-rw-r--r-- | onap-client/onap_client/sdc/service.py | 19 | ||||
-rw-r--r-- | onap-client/setup.py | 2 |
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", |