Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. ospf_route = "O        10.0.24.0/24 [110/41] via 10.0.13.3, 3d18h, FastEthernet0/0"
  2. ospf_route = ospf_route.replace('O', 'OSPF').replace(',', '').replace('[','').replace(']','')
  3. ospf_route = ospf_route.split()
  4. ospf_route.remove('via')
  5.  
  6. proto, prefix, ad_metric, next_hop, last_update, out_int = ospf_route
  7.  
  8. output = '''
  9. {:25}{}
  10. {:25}{}
  11. {:25}{}
  12. {:25}{}
  13. {:25}{}
  14. {:25}{}
  15. '''
  16.  
  17. print( output.format('Protocol:', proto,
  18.                      'Prefix:', prefix,
  19.                      'AD/Metric:', ad_metric,
  20.                      'Next-Hop:', next_hop,
  21.                      'Last update:', last_update,
  22.                      'Outbound Interface:', out_int))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement