Skip to content

Commit

Permalink
Merge pull request #302 from CiscoDevNet/3.5.1
Browse files Browse the repository at this point in the history
Release 3.5.1
  • Loading branch information
mikewiebe authored Aug 14, 2024
2 parents aeac617 + a473794 commit d73b68e
Show file tree
Hide file tree
Showing 31 changed files with 86 additions and 70 deletions.
44 changes: 16 additions & 28 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ansible: [2.9.26, 2.10.17, 2.11.12, 2.12.10, 2.13.8, 2.14.2]
ansible: [2.15.12, 2.16.7]
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Set up Python 3.9
- name: Set up Python "3.10"
uses: actions/setup-python@v1
with:
python-version: 3.9
python-version: "3.10"

- name: Install ansible-base (v${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/v${{ matrix.ansible }}.tar.gz --disable-pip-version-check
Expand All @@ -51,16 +51,16 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ansible: [2.9.26, 2.10.17, 2.11.12, 2.12.10, 2.13.8, 2.14.2]
python: [3.8, 3.9]
ansible: [2.15.12, 2.16.7]
python: ["3.9", "3.10", "3.11"]
exclude:
- ansible: 2.9.26
python: 3.9
- ansible: 2.16.7
python: "3.9"
steps:
- name: Set up Python 3.9
- name: Set up Python (v${{ matrix.python }})
uses: actions/setup-python@v1
with:
python-version: 3.9
python-version: ${{ matrix.python }}

- name: Install ansible-base (v${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/v${{ matrix.ansible }}.tar.gz --disable-pip-version-check
Expand All @@ -71,12 +71,6 @@ jobs:
name: collection
path: .cache/collection-tarballs

- name: Create ansible.cfg file
run: |
echo "[galaxy]" > ansible.cfg
echo "server = https://old-galaxy.ansible.com/" >> ansible.cfg
cat ansible.cfg
- name: Install the collection tarball
run: ansible-galaxy collection install .cache/collection-tarballs/*.tar.gz

Expand All @@ -92,34 +86,28 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ansible: [2.9.26, 2.10.17, 2.11.12, 2.12.10, 2.13.8, 2.14.2]
ansible: [2.15.12, 2.16.7]
steps:
- name: Set up Python 3.9
- name: Set up Python "3.10"
uses: actions/setup-python@v1
with:
python-version: 3.9
python-version: "3.10"

- name: Install ansible-base (v${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/v${{ matrix.ansible }}.tar.gz --disable-pip-version-check

- name: Install coverage (v4.5.4)
run: pip install coverage==4.5.4
- name: Install coverage (v7.3.4)
run: pip install coverage==7.3.4

- name: Install pytest (v5.4.1)
run: pip install pytest==5.4.1
- name: Install pytest (v7.4.4)
run: pip install pytest==7.4.4

- name: Download migrated collection artifacts
uses: actions/download-artifact@v1
with:
name: collection
path: .cache/collection-tarballs

- name: Create ansible.cfg file
run: |
echo "[galaxy]" > ansible.cfg
echo "server = https://old-galaxy.ansible.com/" >> ansible.cfg
cat ansible.cfg
- name: Install the collection tarball
run: ansible-galaxy collection install .cache/collection-tarballs/*.tar.gz

Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ This project adheres to `Semantic Versioning <http://semver.org/>`_.

.. contents:: ``Release Versions``

`3.5.1`_
=====================

**Release Date:** ``2024-06-13``

Fixed
-----

- Fix for ansible-sanity errors in code and documentation
- Updates to supported ansible version

`3.5.0`_
=====================

Expand Down Expand Up @@ -471,6 +482,7 @@ The Ansible Cisco Data Center Network Manager (DCNM) collection includes modules
- cisco.dcnm.dcnm_network - Add and remove Networks from a DCNM managed VXLAN fabric.
- cisco.dcnm.dcnm_interface - DCNM Ansible Module for managing interfaces.

.. _3.5.1: https://github.com/CiscoDevNet/ansible-dcnm/compare/3.5.0...3.5.1
.. _3.5.0: https://github.com/CiscoDevNet/ansible-dcnm/compare/3.4.3...3.5.0
.. _3.4.3: https://github.com/CiscoDevNet/ansible-dcnm/compare/3.4.2...3.4.3
.. _3.4.2: https://github.com/CiscoDevNet/ansible-dcnm/compare/3.4.1...3.4.2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ You can also include it in a `requirements.yml` file and install it with `ansibl
---
collections:
- name: cisco.dcnm
version: 3.5.0
version: 3.5.1
```
## Using this collection
Expand Down
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
namespace: cisco
name: dcnm
version: 3.5.0
version: 3.5.1
readme: README.md
authors:
- Shrishail Kariyappanavar <nkshrishail>
Expand Down
2 changes: 1 addition & 1 deletion meta/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# will redirect to a common action plugin called cisco.dcnm.dcnm
#
#---
requires_ansible: ">=2.9.10"
requires_ansible: ">=2.15.0"
#plugin_routing:
# action:
# dcnm_inventory:
Expand Down
8 changes: 7 additions & 1 deletion plugins/httpapi/dcnm.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@
"""

import json
import requests

# Any third party modules should be imported as below, if not sanity tests will fail
try:
import requests
HAS_REQUESTS = True
except ImportError:
HAS_REQUESTS = False

from ansible.module_utils._text import to_text
from ansible.module_utils.connection import ConnectionError
Expand Down
2 changes: 1 addition & 1 deletion plugins/module_utils/fabric/param_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def _build_info(self) -> None:
self.info = {}
for parameter in self.template.get("parameters", []):
msg = f"{self.class_name}.{method_name}: "
msg += f"parameter: {json.dumps(parameter, indent=4, sort_keys=True)}"
msg += f"parameter: {json.dumps(parameter, indent=4, sort_keys=True)}"
self.log.debug(msg)
param_name = self._get_param_name(parameter)
if param_name not in self.info:
Expand Down
1 change: 0 additions & 1 deletion plugins/module_utils/image_policy/delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import copy
import inspect
import json
import logging

from ansible_collections.cisco.dcnm.plugins.module_utils.common.rest_send import \
Expand Down
1 change: 0 additions & 1 deletion plugins/module_utils/image_policy/payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import inspect
import json
import logging
from typing import Any, Dict

from ansible_collections.cisco.dcnm.plugins.module_utils.image_policy.common import \
ImagePolicyCommon
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/dcnm_image_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
- List of dictionaries containing image policy parameters
type: list
elements: dict
default: []
suboptions:
name:
description:
Expand Down
3 changes: 1 addition & 2 deletions plugins/modules/dcnm_image_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
- A dictionary of images and other related information that is required to download the same.
type: list
elements: dict
default: []
suboptions:
path:
description:
Expand Down Expand Up @@ -176,12 +177,10 @@
import json
import copy

from ansible.module_utils.connection import Connection
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.cisco.dcnm.plugins.module_utils.network.dcnm.dcnm import (
dcnm_send,
validate_list_of_dicts,
dcnm_reset_connection,
dcnm_version_supported,
dcnm_get_protocol_and_address,
dcnm_get_auth_token,
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/dcnm_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
- A dictionary of interface operations
type: list
elements: dict
default: []
suboptions:
name:
description:
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/dcnm_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
- A list of dictionaries containing Links information.
type: list
elements: dict
default: []
suboptions:
dst_fabric:
description:
Expand Down
1 change: 0 additions & 1 deletion plugins/modules/dcnm_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
"""

import json
from json.decoder import JSONDecodeError
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.cisco.dcnm.plugins.module_utils.network.dcnm.dcnm import (
dcnm_send,
Expand Down
8 changes: 1 addition & 7 deletions plugins/modules/dcnm_vpc_pair.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
- A list of dictionaries containing VPC switch pair information
type: list
elements: dict
default: []
suboptions:
peerOneId:
description:
Expand Down Expand Up @@ -397,10 +398,7 @@
# manually running cg_run.py script to generate it again
#

import time
import json
import copy
import ipaddress

from ansible.module_utils.basic import AnsibleModule
from ansible_collections.cisco.dcnm.plugins.module_utils.network.dcnm.dcnm import (
Expand All @@ -410,7 +408,6 @@
get_ip_sn_dict,
get_fabric_inventory_details,
get_fabric_details,
dcnm_get_ip_addr_info,
dcnm_get_template_specs,
dcnm_update_arg_specs,
)
Expand Down Expand Up @@ -440,11 +437,8 @@
dcnm_vpc_pair_utils_get_delete_list,
dcnm_vpc_pair_utils_get_all_filtered_vpc_pair_pairs,
dcnm_vpc_pair_utils_validate_devices,
dcnm_vpc_pair_utils_check_if_meta,
)

from datetime import datetime


# Resource Class object which includes all the required methods and data to configure and maintain Vpc_pair
class DcnmVpcPair:
Expand Down
3 changes: 3 additions & 0 deletions tests/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
modules:
python_requires: ">=3.9"
21 changes: 21 additions & 0 deletions tests/sanity/ignore-2.15.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
plugins/modules/dcnm_vrf.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_image_policy.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_network.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_image_upgrade.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_interface.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_inventory.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_policy.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_rest.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_service_node.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_template.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_service_route_peering.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_service_policy.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_resource_manager.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_links.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_image_upload.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/httpapi/dcnm.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_vpc_pair.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_fabric.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_rest.py import-2.7!skip
plugins/httpapi/dcnm.py import-3.9!skip
plugins/httpapi/dcnm.py import-3.10!skip
18 changes: 18 additions & 0 deletions tests/sanity/ignore-2.16.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
plugins/modules/dcnm_vrf.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_image_policy.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_network.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_image_upgrade.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_interface.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_inventory.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_policy.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_rest.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_service_node.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_template.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_service_route_peering.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_service_policy.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_resource_manager.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_links.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_image_upload.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/httpapi/dcnm.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_vpc_pair.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
plugins/modules/dcnm_fabric.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
2 changes: 0 additions & 2 deletions tests/unit/modules/dcnm/dcnm_image_upgrade/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
import pytest
from ansible_collections.ansible.netcommon.tests.unit.modules.utils import \
AnsibleFailJson
from ansible_collections.cisco.dcnm.plugins.module_utils.common.controller_version import \
ControllerVersion
from ansible_collections.cisco.dcnm.plugins.module_utils.common.params_validate import \
ParamsValidate
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.image_policies import \
Expand Down
3 changes: 0 additions & 3 deletions tests/unit/modules/dcnm/test_dcnm_image_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
from ansible_collections.cisco.dcnm.plugins.modules import dcnm_image_upload
from .dcnm_module import TestDcnmModule, set_module_args, loadPlaybookData

import json
import copy


class TestDcnmImageUploadModule(TestDcnmModule):

Expand Down
3 changes: 0 additions & 3 deletions tests/unit/modules/dcnm/test_dcnm_intf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
from ansible_collections.cisco.dcnm.plugins.modules import dcnm_interface
from .dcnm_module import TestDcnmModule, set_module_args, loadPlaybookData

import json
import copy


class TestDcnmIntfModule(TestDcnmModule):

Expand Down
1 change: 0 additions & 1 deletion tests/unit/modules/dcnm/test_dcnm_inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from ansible_collections.cisco.dcnm.plugins.modules import dcnm_inventory
from .dcnm_module import TestDcnmModule, set_module_args, loadPlaybookData

import json
import copy

__copyright__ = "Copyright (c) 2020 Cisco and/or its affiliates."
Expand Down
3 changes: 0 additions & 3 deletions tests/unit/modules/dcnm/test_dcnm_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
from ansible_collections.cisco.dcnm.plugins.modules import dcnm_links
from .dcnm_module import TestDcnmModule, set_module_args, loadPlaybookData

import json
import copy


class TestDcnmLinksModule(TestDcnmModule):

Expand Down
1 change: 0 additions & 1 deletion tests/unit/modules/dcnm/test_dcnm_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from ansible_collections.cisco.dcnm.plugins.modules import dcnm_network
from .dcnm_module import TestDcnmModule, set_module_args, loadPlaybookData

import json
import copy


Expand Down
3 changes: 0 additions & 3 deletions tests/unit/modules/dcnm/test_dcnm_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
from ansible_collections.cisco.dcnm.plugins.modules import dcnm_policy
from .dcnm_module import TestDcnmModule, set_module_args, loadPlaybookData

import json
import copy


class TestDcnmPolicyModule(TestDcnmModule):

Expand Down
Loading

0 comments on commit d73b68e

Please sign in to comment.