Skip to content

Commit

Permalink
feat: Save versions during device refresh
Browse files Browse the repository at this point in the history
Save the software and content version and ipv6 address during a device
refresh from Panorama.
  • Loading branch information
btorresgil authored and shinmog committed May 6, 2021
1 parent 00f982f commit 7d7a7f9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions panos/firewall.py
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 7d7a7f9

Please sign in to comment.