From 7d7a7f9c5dad2a838a4585f482ae77a1d011f015 Mon Sep 17 00:00:00 2001 From: Brian Torres-Gil Date: Wed, 3 Mar 2021 11:44:12 -0800 Subject: [PATCH] feat: Save versions during device refresh Save the software and content version and ipv6 address during a device refresh from Panorama. --- panos/firewall.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/panos/firewall.py b/panos/firewall.py index 9a43f1db..2136ce4a 100644 --- a/panos/firewall.py +++ b/panos/firewall.py @@ -342,13 +342,10 @@ def refreshall_from_xml(self, xml, refresh_children=False, variables=None): ) op_vars = ( Var("serial"), - Var("ip-address", "management_ip"), - Var("sw-version", "version"), Var("multi-vsys", vartype="bool"), Var("vsys_id", "vsys", default="vsys1"), Var("vsys_name"), Var("ha/state/peer/serial", "serial_ha_peer"), - Var("connected", "state.connected"), ) if len(xml[0]) > 1: # This is a 'show devices' op command @@ -361,11 +358,15 @@ def refreshall_from_xml(self, xml, refresh_children=False, variables=None): system = fw.find_or_create(None, device.SystemSettings) system.hostname = entry.findtext("hostname") system.ip_address = entry.findtext("ip-address") + if entry.findtext("ipv6-address") != "unknown": + system.ipv6_address = entry.findtext("ipv6-address") # Add state fw.state.connected = yesno(entry.findtext("connected")) fw.state.unsupported_version = yesno( entry.findtext("unsupported-version") ) + fw._set_version_and_version_info(entry.findtext("sw-version")) + fw.content_version = entry.findtext("app-version") else: # This is a config command # For each vsys, instantiate a new firewall