# HG changeset patch # User Tero Marttila # Date 1395184114 -7200 # Node ID 9bae04e1780c6d315f52f22bda1143a245fa4677 # Parent 3b6fb4ae56fbe0608fe47b85241024c7a2f40300 pvl.hosts-snmp: use new field syntax for dict attributes, each on their own line, with \t separator diff -r 3b6fb4ae56fb -r 9bae04e1780c bin/pvl.hosts-snmp --- a/bin/pvl.hosts-snmp Wed Mar 19 00:50:12 2014 +0200 +++ b/bin/pvl.hosts-snmp Wed Mar 19 01:08:34 2014 +0200 @@ -281,16 +281,14 @@ print "{host}".format(host=host) for attr, value in sorted(attrs.items()) : - print "\t{attr}".format(attr=' '.join(str(a) for a in attr)), + print "\t{attr}".format(attr=' '.join(str(a) for a in attr)) if isinstance(value, set) : - print for v in sorted(value) : print "\t\t{value}".format(value=v) elif isinstance(value, dict) : for k, v in sorted(value.items()) : - print "\t{key} {value}".format(key=k, value=v), - print + print "\t\t{key}\t{value}".format(key=k, value=v) else : raise Exception("[%s] %s: invalid value: %s" % (host, attr, value))