From b76730131d78999f3e05ca2cb2ac6e60e9554089 Mon Sep 17 00:00:00 2001 From: Joar Heimonen Date: Thu, 23 May 2024 15:44:43 +0200 Subject: [PATCH 1/2] fix: make parse_arp position agnostic --- python/nav/ipdevpoll/plugins/paloaltoarp.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/nav/ipdevpoll/plugins/paloaltoarp.py b/python/nav/ipdevpoll/plugins/paloaltoarp.py index 5d5bd0dc06..fc5ee484df 100644 --- a/python/nav/ipdevpoll/plugins/paloaltoarp.py +++ b/python/nav/ipdevpoll/plugins/paloaltoarp.py @@ -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)) From 4f4e8df33f1b3d463407752f4ce0b323982db191 Mon Sep 17 00:00:00 2001 From: Joar Heimonen Date: Thu, 23 May 2024 16:02:09 +0200 Subject: [PATCH 2/2] added documentation fragment --- changelog.d/2924.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/2924.fixed.md diff --git a/changelog.d/2924.fixed.md b/changelog.d/2924.fixed.md new file mode 100644 index 0000000000..909b4702dc --- /dev/null +++ b/changelog.d/2924.fixed.md @@ -0,0 +1 @@ +Parsing paloalto XML based on keys instead of indexes \ No newline at end of file