From d003ec9565e7491adfb47a3da2dca5d0af3cf2b8 Mon Sep 17 00:00:00 2001 From: KB-perByte Date: Mon, 6 Jan 2025 18:19:42 +0530 Subject: [PATCH] Prep release 6.1.0 --- CHANGELOG.rst | 21 ++- changelogs/changelog.yaml | 22 ++- changelogs/fragments/0-readme.yml | 3 - .../fragments/239-ace-object-group-fix.yml | 2 - .../240-ace-protocol-object-group.yml | 2 - changelogs/fragments/adds_support.yaml | 3 - changelogs/fragments/asa_hardware.yml | 2 - changelogs/fragments/ignore_219.yaml | 3 - galaxy.yml | 2 +- .../network/asa/facts/legacy/base.py | 2 +- tests/unit/compat/__init__.py | 0 tests/unit/compat/mock.py | 130 ------------------ tests/unit/compat/unittest.py | 41 ------ 13 files changed, 42 insertions(+), 191 deletions(-) delete mode 100644 changelogs/fragments/0-readme.yml delete mode 100644 changelogs/fragments/239-ace-object-group-fix.yml delete mode 100644 changelogs/fragments/240-ace-protocol-object-group.yml delete mode 100644 changelogs/fragments/adds_support.yaml delete mode 100644 changelogs/fragments/asa_hardware.yml delete mode 100644 changelogs/fragments/ignore_219.yaml delete mode 100644 tests/unit/compat/__init__.py delete mode 100644 tests/unit/compat/mock.py delete mode 100644 tests/unit/compat/unittest.py diff --git a/CHANGELOG.rst b/CHANGELOG.rst index cdf79c13..1baa8a94 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,25 @@ Cisco Asa Collection Release Notes .. contents:: Topics +v6.1.0 +====== + +Minor Changes +------------- + +- cisco.asa.asa - add support to fetch hardware specific information in facts +- cisco.asa.asa_acls - add support for specifying object-group as protocol + +Bugfixes +-------- + +- cisco.asa.asa_acls - fixed ace parsing when source is object-group and its name contains dots + +Documentation Changes +--------------------- + +- Includes a new support related section in the README. + v6.0.0 ====== @@ -31,7 +50,7 @@ v5.0.0 Release Summary --------------- -Starting from this release, the minimum `ansible-core` version this collection requires is `2.14.0`. The last known version compatible with ansible-core<2.14 is `v4.0.3`. +Starting from this release, the minimum `ansible-core` version this collection requires is `2.14.0`. The last known version compatible with Major Changes ------------- diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index f0a26ea4..5e785905 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -229,10 +229,28 @@ releases: - Bumping `requires_ansible` to `>=2.15.0`, since previous ansible-core versions are EoL now. release_summary: - "With this release, the minimum required version of `ansible-core` + With this release, the minimum required version of `ansible-core` for this collection is `2.15.0`. The last version known to be compatible with - `ansible-core` versions below `2.15` is v5.0.1." + `ansible-core` versions below `2.15` is v5.0.1. fragments: - add_2.18.yaml - bump_215.yaml release_date: "2024-06-11" + 6.1.0: + changes: + bugfixes: + - cisco.asa.asa_acls - fixed ace parsing when source is object-group and its + name contains dots + doc_changes: + - Includes a new support related section in the README. + minor_changes: + - cisco.asa.asa - add support to fetch hardware specific information in facts + - cisco.asa.asa_acls - add support for specifying object-group as protocol + fragments: + - 0-readme.yml + - 239-ace-object-group-fix.yml + - 240-ace-protocol-object-group.yml + - adds_support.yaml + - asa_hardware.yml + - ignore_219.yaml + release_date: "2025-01-06" diff --git a/changelogs/fragments/0-readme.yml b/changelogs/fragments/0-readme.yml deleted file mode 100644 index 6ae0307d..00000000 --- a/changelogs/fragments/0-readme.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -trivial: - - README.md - Add Communication section with Forum information. diff --git a/changelogs/fragments/239-ace-object-group-fix.yml b/changelogs/fragments/239-ace-object-group-fix.yml deleted file mode 100644 index 7cd8e2bb..00000000 --- a/changelogs/fragments/239-ace-object-group-fix.yml +++ /dev/null @@ -1,2 +0,0 @@ -bugfixes: - - cisco.asa.asa_acls - fixed ace parsing when source is object-group and its name contains dots diff --git a/changelogs/fragments/240-ace-protocol-object-group.yml b/changelogs/fragments/240-ace-protocol-object-group.yml deleted file mode 100644 index cc13ebc7..00000000 --- a/changelogs/fragments/240-ace-protocol-object-group.yml +++ /dev/null @@ -1,2 +0,0 @@ -minor_changes: - - cisco.asa.asa_acls - add support for specifying object-group as protocol diff --git a/changelogs/fragments/adds_support.yaml b/changelogs/fragments/adds_support.yaml deleted file mode 100644 index 06f93f76..00000000 --- a/changelogs/fragments/adds_support.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -doc_changes: - - Includes a new support related section in the README. diff --git a/changelogs/fragments/asa_hardware.yml b/changelogs/fragments/asa_hardware.yml deleted file mode 100644 index 1adcc4ab..00000000 --- a/changelogs/fragments/asa_hardware.yml +++ /dev/null @@ -1,2 +0,0 @@ -minor_changes: - - cisco.asa.asa - add support to fetch hardware specific information in facts diff --git a/changelogs/fragments/ignore_219.yaml b/changelogs/fragments/ignore_219.yaml deleted file mode 100644 index d051c421..00000000 --- a/changelogs/fragments/ignore_219.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -trivial: - - Add ignore-2.19.txt. diff --git a/galaxy.yml b/galaxy.yml index 6b978e87..3ac870ab 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -13,4 +13,4 @@ issues: https://github.com/ansible-collections/cisco.asa/issues tags: [cisco, asa, networking, security] # NOTE(pabelanger): We create an empty version key to keep ansible-galaxy # happy. We dynamically inject version info based on git information. -version: 6.0.0 +version: 6.1.0 diff --git a/plugins/module_utils/network/asa/facts/legacy/base.py b/plugins/module_utils/network/asa/facts/legacy/base.py index d256229b..eae64ed2 100644 --- a/plugins/module_utils/network/asa/facts/legacy/base.py +++ b/plugins/module_utils/network/asa/facts/legacy/base.py @@ -122,7 +122,7 @@ def populate(self): if "Invalid input detected" in data: warnings.append("Unable to gather memory statistics") else: - mem_list = [l for l in data.splitlines() if "memory" in l] + mem_list = [mem for mem in data.splitlines() if "memory" in mem] for each in mem_list: if "Free memory" in each: match = re.search( diff --git a/tests/unit/compat/__init__.py b/tests/unit/compat/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/unit/compat/mock.py b/tests/unit/compat/mock.py deleted file mode 100644 index 61ac8870..00000000 --- a/tests/unit/compat/mock.py +++ /dev/null @@ -1,130 +0,0 @@ -# pylint: skip-file -# (c) 2014, Toshio Kuratomi -# -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . - -# Make coding more python3-ish -from __future__ import absolute_import, division, print_function - - -__metaclass__ = type - -""" -Compat module for Python3.x's unittest.mock module -""" -import sys - - -# Python 2.7 - -# Note: Could use the pypi mock library on python3.x as well as python2.x. It -# is the same as the python3 stdlib mock library - -try: - # Allow wildcard import because we really do want to import all of mock's - # symbols into this compat shim - # pylint: disable=wildcard-import,unused-wildcard-import - from unittest.mock import * -except ImportError: - # Python 2 - # pylint: disable=wildcard-import,unused-wildcard-import - try: - from mock import * - except ImportError: - print("You need the mock library installed on python2.x to run tests") - - -# Prior to 3.4.4, mock_open cannot handle binary read_data -if sys.version_info >= (3,) and sys.version_info < (3, 4, 4): - file_spec = None - - def _iterate_read_data(read_data): - # Helper for mock_open: - # Retrieve lines from read_data via a generator so that separate calls to - # readline, read, and readlines are properly interleaved - sep = b"\n" if isinstance(read_data, bytes) else "\n" - data_as_list = [l + sep for l in read_data.split(sep)] - - if data_as_list[-1] == sep: - # If the last line ended in a newline, the list comprehension will have an - # extra entry that's just a newline. Remove this. - data_as_list = data_as_list[:-1] - else: - # If there wasn't an extra newline by itself, then the file being - # emulated doesn't have a newline to end the last line remove the - # newline that our naive format() added - data_as_list[-1] = data_as_list[-1][:-1] - - for line in data_as_list: - yield line - - def mock_open(mock=None, read_data=""): - """ - A helper function to create a mock to replace the use of `open`. It works - for `open` called directly or used as a context manager. - - The `mock` argument is the mock object to configure. If `None` (the - default) then a `MagicMock` will be created for you, with the API limited - to methods or attributes available on standard file handles. - - `read_data` is a string for the `read` methoddline`, and `readlines` of the - file handle to return. This is an empty string by default. - """ - - def _readlines_side_effect(*args, **kwargs): - if handle.readlines.return_value is not None: - return handle.readlines.return_value - return list(_data) - - def _read_side_effect(*args, **kwargs): - if handle.read.return_value is not None: - return handle.read.return_value - return type(read_data)().join(_data) - - def _readline_side_effect(): - if handle.readline.return_value is not None: - while True: - yield handle.readline.return_value - for line in _data: - yield line - - global file_spec - if file_spec is None: - import _io - - file_spec = list( - set(dir(_io.TextIOWrapper)).union(set(dir(_io.BytesIO))), - ) - - if mock is None: - mock = MagicMock(name="open", spec=open) - - handle = MagicMock(spec=file_spec) - handle.__enter__.return_value = handle - - _data = _iterate_read_data(read_data) - - handle.write.return_value = None - handle.read.return_value = None - handle.readline.return_value = None - handle.readlines.return_value = None - - handle.read.side_effect = _read_side_effect - handle.readline.side_effect = _readline_side_effect() - handle.readlines.side_effect = _readlines_side_effect - - mock.return_value = handle - return mock diff --git a/tests/unit/compat/unittest.py b/tests/unit/compat/unittest.py deleted file mode 100644 index df4266ec..00000000 --- a/tests/unit/compat/unittest.py +++ /dev/null @@ -1,41 +0,0 @@ -# (c) 2014, Toshio Kuratomi -# -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . - -# Make coding more python3-ish -from __future__ import absolute_import, division, print_function - - -__metaclass__ = type - -""" -Compat module for Python2.7's unittest module -""" - -import sys - - -# Allow wildcard import because we really do want to import all of -# unittests's symbols into this compat shim -# pylint: disable=wildcard-import,unused-wildcard-import -if sys.version_info < (2, 7): - try: - # Need unittest2 on python2.6 - from unittest2 import * - except ImportError: - print("You need unittest2 installed on python2.6.x to run tests") -else: - from unittest import *