Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #470 from PaloAltoNetworks/develop
Browse files Browse the repository at this point in the history
Bump to v2.4.1
  • Loading branch information
shinmog authored Feb 27, 2020
2 parents 1c46bee + c9d210f commit 132e28f
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ GEM
jekyll-seo-tag (~> 2.1)
minitest (5.11.3)
multipart-post (2.0.0)
nokogiri (1.10.7)
nokogiri (1.10.8)
mini_portile2 (~> 2.4.0)
octokit (4.10.0)
sawyer (~> 0.8.0, >= 0.5.3)
Expand Down
10 changes: 10 additions & 0 deletions docs/history.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Release History
===============

V2.4.1
------

- *Released*: 2020-02-27

Bug Fixes:

* `panos_aggregate_interface`
* `panos_match_rule`

V2.4.0
------

Expand Down
2 changes: 1 addition & 1 deletion library/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = '2.0.4'
__version__ = '2.4.1'
4 changes: 2 additions & 2 deletions library/panos_aggregate_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,15 @@ def main():
# Set references.
try:
changed |= obj.set_vsys(vsys, **reference_params)
changed |= obj.set_zone(zone_name, mode=eth.mode, **reference_params)
changed |= obj.set_zone(zone_name, mode=obj.mode, **reference_params)
changed |= obj.set_virtual_router(vr_name, **reference_params)
except PanDeviceError as e:
module.fail_json(msg='Failed setref: {0}'.format(e))
elif state == 'absent':
# Remove references.
try:
changed |= obj.set_virtual_router(None, **reference_params)
changed |= obj.set_zone(None, mode=eth.mode, **reference_params)
changed |= obj.set_zone(None, mode=obj.mode, **reference_params)
changed |= obj.set_vsys(None, **reference_params)
except PanDeviceError as e:
module.fail_json(msg='Failed setref: {0}'.format(e))
Expand Down
29 changes: 28 additions & 1 deletion library/panos_match_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,40 @@ def main():
module.fail_json(msg='Failed "{0}": {1}'.format(test_string, e))

elm = response.find('./result/rules/entry')
elm2 = response.find('./result/msg/line')
if elm is not None:
try:
rule_name = elm.attrib['name']
except KeyError:
rule_name = elm.text
elif elm2 is not None:
'''
From 8.1 (matching Panorama rule):
NOTE: Ending newlines have been truncated to appease codestyle rules.
<response cmd="status" status="success"><result><msg><line><![CDATA["Rule Name; index: 1" {
from L3-trust;
source [ 10.0.0.1 1.1.1.1 ];
source-region none;
to L3-untrust;
destination [ 8.8.8.8 ];
destination-region none;
user any;
category any;
application/service [0:any/tcp/any/21 1:any/tcp/any/22 ];
action allow;
icmp-unreachable: no
terminal yes;
}
]]></line></msg></result></response>
'''
rule_name = elm2.text.split(';')[0].split('"')[1].strip()
else:
module.exit_json(msg='No matching {0} rule.'.format(rtype))
msg = 'No matching {0} rule; resp = {1}'.format(
rtype, ET.tostring(response, enoding='utf-8'),
)
module.exit_json(msg=msg)

'''
Example response (newlines after newlines to appease pycodestyle line length limitations):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name='ansible-pan',
version='2.4.0',
version='2.4.1',
packages=['library'],
# The project's main homepage.
url='https://github.com/PaloAltoNetworks/ansible-pan',
Expand Down

0 comments on commit 132e28f

Please sign in to comment.