in src/worker/exporters/node_exporter.py [0:0]
def init_ib_config():
global config
global GPU_Mapping
global IB_Mapping
global FIELD_LIST
# IB mapping
cmd = 'ibv_devinfo -l'
result = shell_cmd(cmd, 5)
if 'HCAs found' in result or 'HCA found' in result:
try:
config['counter']['link_flap'] = {}
result = result.split('\n')[1:]
for ib in result:
if "ib" not in ib:
continue
if len(ib):
mapping = re.search(r"ib\d", ib.strip()).group()
config['counter']['link_flap'][mapping] = []
IB_Mapping[mapping] = ib.strip() + ':1'
FIELD_LIST.append('link_flap')
except Exception as e:
logging.exception('Exception occured during configuration. Message: %s', e)
pass