Comments (6)
I'm seeing the same issue trying to pass the following delete debug-log mp-log file *.1
the asterisk isn't being seen as just text but instead being interpreted.
Thank's to someone else's efforts:
So a little bit of context on this issue if you wanted to add it to your comments. The root on this issue is in pan-python. Specifically https://github.com/kevinsteves/pan-python/blob/master/lib/pan/xapi.py#L586
From your command, it is generating '<delete><debug-log><mp-log><file><*.1></*.1></file></mp-log></debug-log></delete>'
which is invalid of course. It would need to generate '<delete><debug-log><mp-log><file>"*.1"</file></mp-log></debug-log></delete>'
from ansible-pan.
Hi zer0nimbus,
I am also facing this issue in "panos_op" module.
using command is "test security-policy-match source 10.0.0.111 destination 2.2.2.2 destination-port 443 protocol 6"
Error message:
UnboundLocalError: local variable 'xml_output' referenced before assignment
fatal: [10.88.10.104]: FAILED! => {
"changed": false,
"module_stderr": "Traceback (most recent call last):\n File "/tmp/ansible_NwWQek/ansible_module_panos_op.py", line 159, in \n main()\n File "/tmp/ansible_NwWQek/ansible_module_panos_op.py", line 152, in main\n obj_dict = xmltodict.parse(xml_output)\nUnboundLocalError: local variable 'xml_output' referenced before assignment\n",
"module_stdout": "",
"msg": "MODULE FAILURE",
"rc": 1
}
I try to understand your explanation change in code, but i am not understand what you change in code.
Could you help me to explain again.
Really appreciate if you help on this issue.
from ansible-pan.
arkaraung1993 -
I have not yet been able to fix this issue. Sorry if I did not make that clear in my initial post.
from ansible-pan.
Is there a fix for this yet?
from ansible-pan.
@zer0nimbus
As it turns out, depending on the command you're attempting to run, you could get one of a few different errors from PAN-OS. It seems like it's best to just always try to run the command a second time, because in your case of trying to run show interface ethernet1/12
, running it the second way would actually work. So I'm going to update the code to do that.
@arkaraung1993
This module will not in its current form work for that particular command. The op
command expects XML as its input, and in this case, the current code would try the following:
<test><security-policy-match><source><10.0.0.111><destination><2.2.2.2><destination-port><443><protocol><6></6></protocol></443></destination-port></2.2.2.2></destination></10.0.0.111></source></security-policy-match></test>
...and when that doesn't work, it will try this:
<test><security-policy-match><source><10.0.0.111><destination><2.2.2.2><destination-port><443><protocol>6</protocol></443></destination-port></2.2.2.2></destination></10.0.0.111></source></security-policy-match></test>
..But what it actually needs to execute is this:
<test><security-policy-match><source>10.0.0.111</source><destination>2.2.2.2</destination><destination-port>443</destination-port><protocol>6</protocol></security-policy-match></test>
I'll open a PR which should solve all of these issues.
from ansible-pan.
This updated panos_op will allow you to give the command as XML if it's more complicated than just a single "back-off", as is the "test security-policy-match" use case above. So you can specify the entire XML, then tell panos_op that it's XML already, so there's no need to try and fiddle with it.
from ansible-pan.
Related Issues (20)
- panos_api_key documentation is faulty. HOT 1
- panos_op documentation missing required library HOT 1
- panos_tag_object fails to delete with unknown color HOT 2
- panos_security_rule_facts do not contain device_group information HOT 1
- panos_security_rule group_profile do not work properly HOT 3
- [request] active sessions manipulations HOT 1
- panos_object_facts.py doesn't honor "delegate_to" configuration HOT 2
- panos_security_rule - source_user from LDAP mapping HOT 2
- Panos_ha doesn't have Priority and Timer Settings HOT 2
- panso_op result query or filtering HOT 2
- Feature Request: Custom URL Categories HOT 2
- Can we create Application Group using the Ansible modules? HOT 2
- Which of the two competing repositories by Palo Alto Networks should I use? HOT 3
- panos_ipsec_tunnel anti_replay option doesn't work HOT 2
- [DEPRECATION WARNING]: Classic provider params are deprecated; use "provider" instead. HOT 1
- Exception when using panos_match_rule (rule_type: nat) and no rule could be found. HOT 1
- panos_interface fails to configure a L2 interface. HOT 1
- panos_nat_rule include target support HOT 1
- Testing only in Localhost can create problem HOT 3
- [Community Health Assessment] Changes needed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-pan.