Fix cluster-list to retrieve vim name and type properly for each cluster 17/14717/1
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 8 Nov 2024 10:51:02 +0000 (11:51 +0100)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 8 Nov 2024 10:51:02 +0000 (11:51 +0100)
Change-Id: I5a5719d3c5a2866d9a8519e61eba875926b53a74
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
osmclient/sol005/cluster.py

index 8062ce4..e5f1614 100644 (file)
@@ -115,13 +115,14 @@ class Cluster(GenericOSMAPIObject):
                 cluster_list1.append(item)
         # Complete cluster info with vim_account name and vim_type
         vim_list = self._client.vim.list()
+        self._logger.debug(f"VIM list: {vim_list}")
         for item in cluster_list1:
             vim_id = item["vim_account"]
             vim_name, vim_type = next(
                 (
                     (vim_item["name"], vim_item["vim_type"])
                     for vim_item in vim_list
-                    if vim_item["_id"] == vim_id or vim_item["name"]
+                    if vim_item["_id"] == vim_id or vim_item["name"] == vim_id
                 ),
                 None,
             )