Fix the watcher not add the host resource in subcloud 93/9793/1
authorZhang Rong(Jon) <rong.zhang@windriver.com>
Sun, 13 Nov 2022 13:07:00 +0000 (21:07 +0800)
committerJackie Huang <jackie.huang@windriver.com>
Fri, 25 Nov 2022 08:18:56 +0000 (16:18 +0800)
Signed-off-by: Zhang Rong(Jon) <rong.zhang@windriver.com>
Change-Id: Ida9f43d64708068c5f41ead82adca67d7d10d875

o2ims/adapter/clients/ocloud_client.py

index 8b73614..9af3b7a 100644 (file)
@@ -89,7 +89,6 @@ class StxPserverClient(BaseClient):
         return self.driver.getPserver(id)
 
     def _list(self, **filters) -> List[ocloudModel.StxGenericModel]:
-        filters['resourcepoolid']
         return self.driver.getPserverList(**filters)
 
     def _set_stx_client(self):
@@ -315,7 +314,8 @@ class StxClientImp(object):
         systems = self.stxclient.isystem.list()
         logger.debug('systems:' + str(systems[0].to_dict()))
         return ocloudModel.StxGenericModel(
-            ResourceTypeEnum.RESOURCE_POOL, systems[0]) if systems else None
+            ResourceTypeEnum.RESOURCE_POOL,
+            self._respoolconverter(systems[0])) if systems else None
 
     def getPserverList(self, **filters) -> List[ocloudModel.StxGenericModel]:
         hosts = self.stxclient.ihost.list()
@@ -323,6 +323,7 @@ class StxClientImp(object):
         return [ocloudModel.StxGenericModel(
             ResourceTypeEnum.PSERVER, self._hostconverter(host))
             for host in hosts if host and (host.availability == 'available'
+                                           or host.availability == 'online'
                                            or host.availability == 'degraded')]
 
     def getPserver(self, id) -> ocloudModel.StxGenericModel: