vim_type = CollectorService._get_vim_type(conf, vim_account_id)
log.debug("vim type.....{}".format(vim_type))
if vim_type in VIM_COLLECTORS:
- collector = VIM_COLLECTORS[vim_type](conf, vim_account_id, vim_sess_map[vim_account_id])
+ collector = VIM_COLLECTORS[vim_type](
+ conf, vim_account_id, vim_sess_map[vim_account_id]
+ )
metrics = collector.collect(vnfr)
log.debug("Collecting vim metrics.....{}".format(metrics))
else:
vim_type = CollectorService._get_vim_type(self.conf, vim["_id"])
if vim_type in VIM_INFRA_COLLECTORS:
collector = VIM_INFRA_COLLECTORS[vim_type](self.conf, vim["_id"])
- vim_sess = collector.vim_session if vim_type == "openstack" else None
+ vim_sess = (
+ collector.vim_session
+ if (vim_type == "openstack" or vim_type == "vio")
+ else None
+ )
# Populate the vim session map with vim ids and corresponding session objects
# vim session objects are stopred only for vim type openstack
if vim_sess:
# Starting executor pool with pool size process_pool_size. Default process_pool_size is 20
# init_session is called to assign the session map to the gloabal vim session map variable
with concurrent.futures.ProcessPoolExecutor(
- self.conf.get("collector", "process_pool_size"), initializer=init_session, initargs=(vim_sess_map,)
+ self.conf.get("collector", "process_pool_size"),
+ initializer=init_session,
+ initargs=(vim_sess_map,),
) as executor:
log.info(
"Started metric collector process pool with pool size %s"