pvl.hosts-lldp: output host location
authorTero Marttila <terom@paivola.fi>
Mon, 17 Mar 2014 17:46:48 +0200
changeset 386 9e1abcf47d27
parent 385 01d31fda75ab
child 387 75158fd28784
pvl.hosts-lldp: output host location
bin/pvl.hosts-lldp
--- a/bin/pvl.hosts-lldp	Mon Mar 17 17:36:59 2014 +0200
+++ b/bin/pvl.hosts-lldp	Mon Mar 17 17:46:48 2014 +0200
@@ -105,9 +105,9 @@
     # apply
     for host, local, remote, remote_host in apply_hosts_lldp(options, hosts) :
         if remote_host :
-            print "{host:30} {local[port]:25} <-> {remote[port]:25} {remote_host:30}".format(host=host, local=local, remote=remote, remote_host=remote_host)
+            print "{host:30} {host.location:>30} {local[port]:>25} <-> {remote[port]:<25} {remote_host.location:>30} # {remote[chassis]} ({remote_host})".format(host=host, local=local, remote=remote, remote_host=remote_host)
         else :
-            print "{host:30} {local[port]:25} <-- {remote[port]:25} # {remote[chassis]} ({remote[sys_name]})".format(host=host, local=local, remote=remote)
+            print "{host:30} {host.location:>30} {local[port]:>25} <-- {remote[port]:<25} {empty:30} # {remote[chassis]} ({remote[sys_name]})".format(host=host, local=local, remote=remote, empty='')
 
 if __name__ == '__main__':
     pvl.args.main(main)