mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-22 09:32:21 +00:00
Have nodeinventory disambiguate duplicate labels.
The data is still there for putting identical cards together, but the prefix is unique, particularly important for json mode.
This commit is contained in:
parent
e7be24d478
commit
07532e2a3f
@ -87,6 +87,7 @@ def printerror(res, node=None):
|
||||
|
||||
|
||||
url = '/noderange/{0}/inventory/hardware/all/all'
|
||||
usedprefixes = set([])
|
||||
|
||||
argparser = optparse.OptionParser(
|
||||
usage="Usage: %prog <noderange> [serial|model|uuid|mac]")
|
||||
@ -129,6 +130,11 @@ try:
|
||||
continue
|
||||
for inv in res['databynode'][node]['inventory']:
|
||||
prefix = inv['name']
|
||||
idx = 2
|
||||
while prefix in usedprefixes:
|
||||
prefix = '{0} {1}'.format(inv['name'], idx)
|
||||
idx += 1
|
||||
usedprefixes.add(prefix)
|
||||
if not inv['present']:
|
||||
if not filters:
|
||||
if options.json:
|
||||
|
Loading…
Reference in New Issue
Block a user