Guest User

Untitled

a guest
Sep 18th, 2013
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. # Management ip interface
  2. ipif = self.cli("ip show")
  3. mgmt_vlan = self.cli("switch vlan cpu show")
  4. sys_mac = self.cli("sys info show")
  5. mac = re.findall(self.rx_mac, sys_mac)[0]
  6. vl = mgmt_vlan.splitlines()[0].split(":")[1].strip()
  7. ip = [IPv4(parse_table(ipif)[0][1], netmask = parse_table(ipif)[0][2]).prefix]
  8. i = [{
  9. 'admin_status': True,
  10. 'enabled_protocols': [],
  11. 'mac': mac,
  12. 'name': vl,
  13. 'oper_status': True,
  14. 'subinterfaces': [{'admin_status': True,
  15. 'enabled_afi': ['IPv4'],
  16. 'enabled_protocols': [],
  17. 'ipv4_addresses': ip,
  18. 'mac': mac,
  19. 'name': vl,
  20. 'oper_status': True,
  21. 'vlan_ids': [vl]}],
  22. 'type': 'SVI'
  23. }]
Advertisement
Add Comment
Please, Sign In to add comment