backport/2.8/57187 update ce_facts to fix array out of range bug (#57187) (#57698)

* update ce_facts (#57187)


(cherry picked from commit 229d20b6d9)

* add a changlog fragment for PR 57698
pull/57976/head
YuandongXu 7 years ago committed by Toshio Kuratomi
parent d419a2777c
commit 1b073fccc2

@ -0,0 +1,2 @@
bugfixes:
- update ce_facts to fix array out of range bug(https://github.com/ansible/ansible/pull/57187).

@ -324,7 +324,10 @@ class Interfaces(FactsBase):
tmp_neighbors = neighbors[2:]
for item in tmp_neighbors:
tmp_item = item.split()
neighbors_dict[tmp_item[0]] = tmp_item[3]
if len(tmp_item) > 3:
neighbors_dict[tmp_item[0]] = tmp_item[3]
else:
neighbors_dict[tmp_item[0]] = None
self.facts['neighbors'] = neighbors_dict

Loading…
Cancel
Save