diff --git a/confluent_client/bin/nodelist b/confluent_client/bin/nodelist index fdd354f7..14b3fc87 100644 --- a/confluent_client/bin/nodelist +++ b/confluent_client/bin/nodelist @@ -27,6 +27,20 @@ if path.startswith('/opt'): sys.path.append(path) import confluent.client as client + + +def attrrequested(attr, attrlist, seenattributes): + for candidate in attrlist: + truename = candidate + if candidate.startswith('hm'): + candidate = candidate.replace('hm', 'hardwaremanagement', 1) + if candidate == attr: + seenattributes.add(truename) + return True + elif '.' not in candidate and attr.startswith(candidate + '.'): + seenattributes.add(truename) + return True + return False argparser = optparse.OptionParser( usage="Usage: %prog [options] noderange [list of attributes") argparser.add_option('-b', '--blame', action='store_true', @@ -50,7 +64,7 @@ if len(args) > 1: for attr in res['databynode'][node]: seenattributes.add(attr) currattr = res['databynode'][node][attr] - if attr in args[1:]: + if attrrequested(attr, args[1:], seenattributes): if 'value' in currattr: if currattr['value'] is not None: attrout = '{0}: {1}: {2}'.format(