Skip to content

Commit

Permalink
Added fix for panorama check for FWs in version PAN-OS 11 or later
Browse files Browse the repository at this point in the history
  • Loading branch information
horiagunica committed Mar 4, 2024
1 parent 4fec622 commit ac393f9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions panos_upgrade_assurance/firewall_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,19 @@ def is_panorama_connected(self) -> bool:
raise exceptions.MalformedResponseException("Response from device is not type of string.")

pan_status_list = pan_status.split("\n")
print(pan_status_list)
pan_status_list_length = len(pan_status_list)

if pan_status_list_length in [3, 7]:
for i in range(1, pan_status_list_length, 4):
pan_connected = interpret_yes_no((pan_status_list[i].split(":")[1]).strip())
if pan_connected:
return True
elif pan_status_list_length in [3, 6]:
for i in range(1, pan_status_list_length, 3):
pan_connected = interpret_yes_no((pan_status_list[i].split(":")[1]).strip())
if pan_connected:
return True
else:
raise exceptions.MalformedResponseException(
f"Panorama configuration block does not have typical structure: <{pan_status}>."
Expand Down

0 comments on commit ac393f9

Please sign in to comment.