Check if addr is short IPv6

When the addr is sent as a short IPv6 address, e.g., `2804:3be0::`,
if might be conflated with the `28:04:3B:E0:00:00` MAC address,
which makes the runner look into other data sets than it should.
This commit is contained in:
Mircea Ulinic 2017-09-22 09:17:14 +00:00
parent 765504c137
commit 4b2f791bd2

View file

@ -75,6 +75,7 @@ from __future__ import unicode_literals
# Import salt lib
import salt.output
import salt.utils.network
from salt.ext import six
from salt.ext.six.moves import map
@ -844,6 +845,8 @@ def find(addr, best=True, display=_DEFAULT_DISPLAY):
except IndexError:
# no problem, let's keep searching
pass
if salt.utils.network.is_ipv6(addr):
mac = False
if not mac:
try:
ip = napalm_helpers.convert(napalm_helpers.ip, addr) # pylint: disable=invalid-name