From: jkraitbewr Date: Thu, 1 Feb 2024 15:16:16 +0000 (-0500) Subject: Updated distcloud for subcloud region_name changes X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=pti%2Fo2.git;a=commitdiff_plain;h=79323988bfb68d23a9d781843c0b73f3fa463809 Updated distcloud for subcloud region_name changes There has been a breaking change in the distcloud package. In the O2 code it's assumed the subcloud_name == subcloud_region_name. This is no longer true or the default. TEST PLAN PASS: Run docker-compose unit testing PASS: Run compliance and quality robot tests, with mock SMO * Deploy oran-o2 application on StarlingX system controller (stx9) * Update/apply override for dev image * Ensure O2 pod is running using correct image Issue-ID: INF-439 Signed-off-by: jkraitbewr Change-Id: If4dc8d9d30ef24d6b93cfe436eb332760432c9a1 --- diff --git a/README-docker-compose.md b/README-docker-compose.md index b1e1647..6ba891c 100644 --- a/README-docker-compose.md +++ b/README-docker-compose.md @@ -35,8 +35,8 @@ cd o2 mkdir -p temp cd temp git clone --depth 1 --branch r/stx.7.0 https://opendev.org/starlingx/config.git -git clone --depth 1 --branch r/stx.7.0 https://opendev.org/starlingx/distcloud-client.git - +git clone --branch master https://opendev.org/starlingx/distcloud-client.git +(cd distcloud-client && git reset --hard eb4e7eeeb09bdf2e1b80984b378c5a8ea9930f04) git clone --depth 1 --branch r/stx.7.0 https://opendev.org/starlingx/fault.git cd - diff --git a/README-o2imsbuilder.md b/README-o2imsbuilder.md index 70547c8..adb5e42 100644 --- a/README-o2imsbuilder.md +++ b/README-o2imsbuilder.md @@ -36,8 +36,9 @@ cd o2 mkdir -p temp cd temp -git clone --depth 1 --branch master https://opendev.org/starlingx/config.git -git clone --depth 1 --branch master https://opendev.org/starlingx/distcloud-client.git +git clone --depth 1 --branch r/stx.7.0 https://opendev.org/starlingx/config.git +git clone --branch master https://opendev.org/starlingx/distcloud-client.git +(cd distcloud-client && git reset --hard eb4e7eeeb09bdf2e1b80984b378c5a8ea9930f04) cd - docker-compose build diff --git a/README.md b/README.md index ab9166e..6dbcbaf 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,10 @@ cloned into temp before docker building ```sh mkdir -p temp cd temp -git clone --branch master https://opendev.org/starlingx/config.git -git clone --depth 1 --branch r/stx.7.0 https://opendev.org/starlingx/distcloud-client.git -git clone --depth 1 --branch master https://opendev.org/starlingx/fault.git +git clone --branch r/stx.7.0 https://opendev.org/starlingx/config.git +git clone --branch master https://opendev.org/starlingx/distcloud-client.git +(cd distcloud-client && git reset --hard eb4e7eeeb09bdf2e1b80984b378c5a8ea9930f04) +git clone --depth 1 --branch r/stx.7.0 https://opendev.org/starlingx/fault.git cd config git checkout bca406d1 patch -p1 < ../../cgtsclient-insecure.patch diff --git a/o2ims/adapter/clients/ocloud_client.py b/o2ims/adapter/clients/ocloud_client.py index 6c682a2..4e8430f 100644 --- a/o2ims/adapter/clients/ocloud_client.py +++ b/o2ims/adapter/clients/ocloud_client.py @@ -226,9 +226,11 @@ class StxClientImp(object): subcloud_additional_details(subcloud_id) logger.debug('subcloud name: %s, oam_floating_ip: %s' % (subcloud[0].name, subcloud[0].oam_floating_ip)) + if subcloud[0].oam_floating_ip == 'unavailable': + raise EnvironmentError(f"{subcloud[0].name} was unavailable") try: os_client_args = config.get_stx_access_info( - region_name=subcloud[0].name, + region_name=subcloud[0].region_name, subcloud_hostname=subcloud[0].oam_floating_ip) # logger.info(os_client_args) config_client = get_stx_client(**os_client_args) @@ -236,7 +238,7 @@ class StxClientImp(object): msg = e.format_message() if CGTSCLIENT_ENDPOINT_ERROR_MSG in msg: os_client_args = config.get_stx_access_info( - region_name=subcloud[0].name, sub_is_https=True, + region_name=subcloud[0].region_name, sub_is_https=True, subcloud_hostname=subcloud[0].oam_floating_ip) # logger.info(os_client_args) config_client = get_stx_client(**os_client_args) diff --git a/requirements-stx.txt b/requirements-stx.txt index 77555c6..88effb5 100644 --- a/requirements-stx.txt +++ b/requirements-stx.txt @@ -2,6 +2,6 @@ # -e git+https://opendev.org/starlingx/config.git@master#egg=cgtsclient&subdirectory=sysinv/cgts-client/cgts-client # -e git+https://opendev.org/starlingx/fault.git@master#egg=fmclient&subdirectory=python-fmclient/fmclient --e git+https://opendev.org/starlingx/distcloud-client.git@r/stx.7.0#egg=distributedcloud-client&subdirectory=distributedcloud-client +-e git+https://opendev.org/starlingx/distcloud-client.git@eb4e7eeeb09bdf2e1b80984b378c5a8ea9930f04#egg=distributedcloud-client&subdirectory=distributedcloud-client -e git+https://opendev.org/starlingx/config.git@r/stx.7.0#egg=cgtsclient&subdirectory=sysinv/cgts-client/cgts-client -e git+https://opendev.org/starlingx/fault.git@r/stx.7.0#egg=fmclient&subdirectory=python-fmclient/fmclient