napalm-automation-community / napalm-dellos10

NAPALM Driver for Dell EMC OS10 Enterprise
http://dellos10-napalm.readthedocs.io/en/latest/
Apache License 2.0
10 stars 11 forks source link

get_interfaces_ip gets fails with interfaces with only IPv6 address #30

Closed rasanentimo closed 3 years ago

rasanentimo commented 3 years ago

Steps to Reproduce

Run the code against a device which has only IPv6 address configured to one interface.

Expected and Actual Results

Expected to get list interfaces with IP addresses

>>> device.get_interfaces_ip()
in ip
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../napalm-dellos10/napalm_dellos10/dellos10.py", line 1014, in get_interfaces_ip
    ipv6_prefix = self.convert_int(ip_split_list[1])
UnboundLocalError: local variable 'ip_split_list' referenced before assignment

The code should refer to ipv6_split_list instead. Currently IPv6 addresses will get the mask of IPv4 address if that is configured.