pvl.hosts-snmp: use new field syntax for dict attributes, each on their own line, with \t separator
authorTero Marttila <terom@paivola.fi>
Wed, 19 Mar 2014 01:08:34 +0200
changeset 403 9bae04e1780c
parent 402 3b6fb4ae56fb
child 404 78e3d83135ab
pvl.hosts-snmp: use new field syntax for dict attributes, each on their own line, with \t separator
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))