Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make parse_arp index agnostic #2925

Merged
merged 2 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/2924.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Parsing paloalto XML based on keys instead of indexes
8 changes: 4 additions & 4 deletions python/nav/ipdevpoll/plugins/paloaltoarp.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ def parse_arp(arp):
arps = []

root = ET.fromstring(arp)
entries = root[0][4]
entries = root.find("result").find("entries")
for entry in entries:
status = entry[0].text
ip = entry[1].text
mac = entry[2].text
status = entry.find("status").text
ip = entry.find("ip").text
mac = entry.find("mac").text
if status.strip() != "i":
if mac != "(incomplete)":
arps.append(('ifindex', IP(ip), mac))
Expand Down
Loading