Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Management ip interface
- ipif = self.cli("ip show")
- mgmt_vlan = self.cli("switch vlan cpu show")
- sys_mac = self.cli("sys info show")
- mac = re.findall(self.rx_mac, sys_mac)[0]
- vl = mgmt_vlan.splitlines()[0].split(":")[1].strip()
- ip = [IPv4(parse_table(ipif)[0][1], netmask = parse_table(ipif)[0][2]).prefix]
- i = [{
- 'admin_status': True,
- 'enabled_protocols': [],
- 'mac': mac,
- 'name': vl,
- 'oper_status': True,
- 'subinterfaces': [{'admin_status': True,
- 'enabled_afi': ['IPv4'],
- 'enabled_protocols': [],
- 'ipv4_addresses': ip,
- 'mac': mac,
- 'name': vl,
- 'oper_status': True,
- 'vlan_ids': [vl]}],
- 'type': 'SVI'
- }]
Advertisement
Add Comment
Please, Sign In to add comment