@@ -105,7 +105,7 @@ def __hash__(self):
105105)
106106
107107KiKiMRHost = collections .namedtuple (
108- "_KiKiMRHost" , ["hostname" , "node_id" , "drives" , "ic_port" , "body" , "datacenter" , "rack" , "host_config_id" , "port" ]
108+ "_KiKiMRHost" , ["hostname" , "node_id" , "drives" , "ic_port" , "body" , "datacenter" , "module" , " rack" , "host_config_id" , "port" ]
109109)
110110
111111DEFAULT_PLAN_RESOLUTION = 10
@@ -417,6 +417,16 @@ def _get_body(self, host_description):
417417
418418 return str (self ._host_info_provider .get_body (host_description .get ("name" , host_description .get ("host" ))))
419419
420+ def _get_module (self , host_description ):
421+ if host_description .get ("module" ) is not None :
422+ return str (host_description .get ("module" ))
423+ module = host_description .get ("location" , {}).get ("module" , None )
424+ if module is not None :
425+ return str (module )
426+
427+ module_from_provider = self ._host_info_provider .get_module (host_description .get ("name" , host_description .get ("host" )))
428+ return str (module_from_provider ) if module_from_provider else ""
429+
420430 def _collect_drives_info (self , host_description ):
421431 host_config_id = host_description .get ("host_config_id" , None )
422432 drives = host_description .get ("drives" , [])
@@ -439,6 +449,7 @@ def __collect_host_info(self, node_id, host_description):
439449 ic_port = host_description .get ("ic_port" , DEFAULT_INTERCONNECT_PORT ),
440450 body = self ._get_body (host_description ),
441451 datacenter = self ._get_datacenter (host_description ),
452+ module = self ._get_module (host_description ),
442453 rack = self ._get_rack (host_description ),
443454 host_config_id = host_description .get ("host_config_id" , None ),
444455 port = host_description .get ("port" , DEFAULT_INTERCONNECT_PORT ),
0 commit comments