Updated distcloud for subcloud region_name changes 98/12498/3
authorjkraitbewr <joshua.kraitberg@windriver.com>
Thu, 1 Feb 2024 15:16:16 +0000 (10:16 -0500)
committerjkraitbewr <joshua.kraitberg@windriver.com>
Tue, 6 Feb 2024 15:11:51 +0000 (10:11 -0500)
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 <joshua.kraitberg@windriver.com>
Change-Id: If4dc8d9d30ef24d6b93cfe436eb332760432c9a1

README-docker-compose.md
README-o2imsbuilder.md
README.md
o2ims/adapter/clients/ocloud_client.py
requirements-stx.txt

index b1e1647..6ba891c 100644 (file)
@@ -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 -
 
index 70547c8..adb5e42 100644 (file)
@@ -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
index ab9166e..6dbcbaf 100644 (file)
--- 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
index 6c682a2..4e8430f 100644 (file)
@@ -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)
index 77555c6..88effb5 100644 (file)
@@ -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