pvl.hosts-snmp: use new field syntax for dict attributes, each on their own line, with \t separator
--- 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))