bin/pvl.hosts-lldp
changeset 386 9e1abcf47d27
parent 384 caa3dbbdbe83
child 387 75158fd28784
equal deleted inserted replaced
385:01d31fda75ab 386:9e1abcf47d27
   103     hosts = pvl.hosts.apply(options, args)
   103     hosts = pvl.hosts.apply(options, args)
   104     
   104     
   105     # apply
   105     # apply
   106     for host, local, remote, remote_host in apply_hosts_lldp(options, hosts) :
   106     for host, local, remote, remote_host in apply_hosts_lldp(options, hosts) :
   107         if remote_host :
   107         if remote_host :
   108             print "{host:30} {local[port]:25} <-> {remote[port]:25} {remote_host:30}".format(host=host, local=local, remote=remote, remote_host=remote_host)
   108             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)
   109         else :
   109         else :
   110             print "{host:30} {local[port]:25} <-- {remote[port]:25} # {remote[chassis]} ({remote[sys_name]})".format(host=host, local=local, remote=remote)
   110             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='')
   111 
   111 
   112 if __name__ == '__main__':
   112 if __name__ == '__main__':
   113     pvl.args.main(main)
   113     pvl.args.main(main)