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

Getting XML Parsing Errors When Interacting to AWS Based Panoramas #508

Open
ncarabajal opened this issue May 12, 2023 · 1 comment
Open
Labels

Comments

@ncarabajal
Copy link

Describe the bug

I have a script that uses the panos library and when used against Panorama in AWS I get a parsing error. Below is that error:

File "/Users/ncarabaj/Desktop/pre-post-rule-download/panorama-info-version-1.py", line 127, in
main()
File "/Users/ncarabaj/Desktop/pre-post-rule-download/panorama-info-version-1.py", line 117, in main
device_groups = DeviceGroup.refreshall(panorama)
File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 1338, in refreshall
instances = class_instance.refreshall_from_xml(obj)
File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 1404, in refreshall_from_xml
instance._refresh_children(xml=obj)
File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 1038, in _refresh_children
l = child.refreshall_from_xml(childroot)
File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 1389, in refreshall_from_xml
instance.parse_xml(obj)
File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 2789, in parse_xml
var_path.parse_xml(xml, settings, possibilities)
File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 3223, in parse_xml
self.parse_value_from_xml_last_tag(e, settings, attr)
File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 3306, in parse_value_from_xml_last_tag
settings[self.param] = int(elm.text)
ValueError: invalid literal for int() with base 10: '0-8'

Expected behavior

Should authenticate and parse

Current behavior

Possible solution

Need to be able to ingest the xml config from AWS

Steps to reproduce

  1. Run the code in the link against AWS Panorama

Screenshots

N/A

Context

Trying to gather pre and post security and nat rulebase from Pano. It does work on others just not ones in AWS.

Your Environment

  • Environment name and version (e.g. Chrome 59, node.js 5.4, python 3.7.3):

Python 3.11.3

  • Operating System and version (desktop or mobile):

MacOS Catalina Version 10.15.7 - User laptop
Panorama version 10.1.9
aws-2.0.2

  • Link to your project:

https://github.com/ncarabajal/pano-info

@ncarabajal ncarabajal added the bug label May 12, 2023
@welcome-to-palo-alto-networks

🎉 Thanks for opening your first issue here! Welcome to the community!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant