Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -r 40f55fbce410 inv/discovery/jobs/link_discovery.py
- --- a/inv/discovery/jobs/link_discovery.py Thu May 08 09:40:58 2014 +0400
- +++ b/inv/discovery/jobs/link_discovery.py Thu May 08 12:43:32 2014 +0400
- @@ -45,13 +45,19 @@
- """
- i = Interface.objects.filter(
- managed_object=object.id, name=name).first()
- - if not i:
- - # JUNOS names fixup
- - si = list(SubInterface.objects.filter(
- - managed_object=object.id, name=name))
- - if len(si) == 1:
- - i = si[0].interface
- - return i
- + if i:
- + return i
- + # Construct alternative names
- + alt_names = object.profile.get_interface_names(name)
- + nn = object.profile.convert_interface_name(name)
- + if nn != name:
- + alt_names = [nn] + alt_names
- + for n in alt_names:
- + i = Interface.objects.filter(
- + managed_object=object.id, name=n).first()
- + if i:
- + return i
- + return None
- def submit_candidate(self, local_interface,
- remote_object, remote_interface=None):
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement