2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-08 12:36:03 +00:00

Fix non-unique name for similar inventory items.

This commit is contained in:
Jarrod Johnson 2018-09-07 11:16:09 -04:00
parent abc15974da
commit 47a53a51e4

View File

@ -410,6 +410,7 @@ persistent_ipmicmds = {}
class IpmiHandler(object):
def __init__(self, operation, node, element, cfd, inputdata, cfg, output):
self.sensormap = {}
self.usedlabels = {}
self.invmap = {}
self.output = output
self.sensorcategory = None
@ -916,7 +917,12 @@ class IpmiHandler(object):
if vstr:
newinf['information']['PCI Vendor'] = vstr
if dstr:
newinf['name'] = dstr
newname = dstr
instance = 1
while newname in self.usednames:
instance += 1
newname = dstr + ' {1}'.format(instance)
newinf['name'] = newname
invitems.append(newinf)
def handle_sensors(self):