Skip to content

Commit 0b27a0c

Browse files
authored
Merge pull request #324 from cisco-en-programmability/develop
chore: deprecate cisco.dnac collection in favor of cisco.catalystcent…
2 parents 80d94d2 + 79dfcd3 commit 0b27a0c

7 files changed

Lines changed: 78 additions & 42 deletions

File tree

.github/workflows/sanity_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
runs-on: ubuntu-22.04
2424
steps:
2525
- name: Check out code
26-
uses: actions/checkout@v3
26+
uses: actions/checkout@v4
2727
with:
2828
path: cisco-en-programmability/dnacenter-ansible
2929

@@ -34,7 +34,7 @@ jobs:
3434
run: mv ./cisco-en-programmability/dnacenter-ansible ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
3535

3636
- name: Set up Python
37-
uses: actions/setup-python@v3
37+
uses: actions/setup-python@v5
3838
with:
3939
python-version: '3.12'
4040

.github/workflows/sanity_tests_devel.yml

Lines changed: 47 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,36 @@ jobs:
4949
5050
- name: Run sanity tests
5151
run: |
52-
if [ -s changed_files.txt ]; then
53-
changed_files=$(cat changed_files.txt)
54-
for file in $changed_files; do
55-
# Ensure file paths are relative to the working directory
56-
if [ -f "$file" ]; then
57-
echo "Running ansible sanity test for file: $file"
58-
ansible-test sanity --docker -v --color yes $file
59-
else
60-
echo "File not found: $file"
61-
fi
62-
done
63-
echo "Ansible sanity tests completed successfully."
64-
else
52+
if [ ! -s changed_files.txt ]; then
6553
echo "No changed files to test."
54+
exit 0
55+
fi
56+
57+
testable_files=""
58+
file_count=0
59+
while IFS= read -r file; do
60+
if [ -f "$file" ]; then
61+
testable_files="$testable_files $file"
62+
file_count=$((file_count + 1))
63+
fi
64+
done < changed_files.txt
65+
66+
echo "Testable files: $file_count"
67+
68+
if [ "$file_count" -eq 0 ]; then
69+
echo "No existing files to test."
70+
exit 0
71+
elif [ "$file_count" -le 50 ]; then
72+
echo "Running targeted sanity tests on $file_count files..."
73+
ansible-test sanity --docker -v --color yes $testable_files
74+
else
75+
echo "Large changeset ($file_count files). Running full sanity tests..."
76+
while true; do echo "Sanity tests still running..."; sleep 60; done &
77+
KEEPALIVE_PID=$!
78+
timeout 55m ansible-test sanity --docker -v --color
79+
EXIT_CODE=$?
80+
kill $KEEPALIVE_PID 2>/dev/null
81+
exit $EXIT_CODE
6682
fi
6783
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
6884

@@ -71,29 +87,24 @@ jobs:
7187

7288
- name: Run yamllint
7389
run: |
74-
if [ -s changed_files.txt ]; then
75-
changed_files=$(cat changed_files.txt)
76-
lintable_files=""
77-
for file in $changed_files; do
78-
# Check if the file belongs to the playbooks directory and has .yml or .yaml extension
79-
if [[ $file == playbooks/*.yml || $file == playbooks/*.yaml ]]; then
80-
# Verify the file exists before adding it
81-
if [ -f "$file" ]; then
82-
lintable_files="$lintable_files $file"
83-
fi
84-
fi
85-
done
86-
87-
echo "Lintable Files: $lintable_files"
88-
89-
if [ -n "$lintable_files" ]; then
90-
echo "Running yamllint test for files: $lintable_files"
91-
yamllint -c .yamllint.yml $lintable_files
92-
echo "Yamllint tests completed successfully."
93-
else
94-
echo "No relevant files to lint."
95-
fi
96-
else
90+
if [ ! -s changed_files.txt ]; then
9791
echo "No changed files to lint."
92+
exit 0
9893
fi
94+
95+
lintable_files=""
96+
while IFS= read -r file; do
97+
if [ -f "$file" ] && [[ "$file" == playbooks/*.yml || "$file" == playbooks/*.yaml ]]; then
98+
lintable_files="$lintable_files $file"
99+
fi
100+
done < changed_files.txt
101+
102+
if [ -z "$lintable_files" ]; then
103+
echo "No relevant playbook files to lint."
104+
exit 0
105+
fi
106+
107+
echo "Running yamllint on:$lintable_files"
108+
yamllint -c .yamllint.yml $lintable_files
109+
echo "Yamllint completed successfully."
99110
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Ansible Collection: cisco.dnac
22

3+
> **DEPRECATED:** This collection is deprecated and will be removed in a future release.
4+
> Please migrate to [cisco.catalystcenter](https://galaxy.ansible.com/cisco/catalystcenter),
5+
> which provides the same functionality under the updated Cisco Catalyst Center branding.
6+
37
## Overview
48

59
The cisco.dnac Ansible Collection enables enterprise automation and management of Cisco CATALYST Center environments. It provides modules that interact with Cisco CATALYST Center APIs to automate provisioning, configuration, and operational workflows.

changelogs/changelog.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1963,3 +1963,11 @@ releases:
19631963
- Changes in wireless_design_workflow_manager module
19641964
- Standardized README format and content to match Catalyst Center Ansible collection documentation practices.
19651965
- Added build_ignore configuration to optimize Ansible Galaxy collection packaging.
1966+
1967+
6.48.1:
1968+
release_date: "2026-03-05"
1969+
changes:
1970+
release_summary: Deprecation of the cisco.dnac collection in favor of cisco.catalystcenter.
1971+
deprecated_features:
1972+
- The cisco.dnac collection is now deprecated. Please migrate to cisco.catalystcenter, which provides the same functionality under the updated Cisco Catalyst Center branding.
1973+
- All modules now emit a deprecation warning at runtime directing users to cisco.catalystcenter.

galaxy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
namespace: cisco
33
name: dnac
4-
version: 6.48.0
4+
version: 6.48.1
55
readme: README.md
66
authors:
77
- Rafael Campos <rcampos@cloverhound.com>
@@ -32,7 +32,7 @@ authors:
3232
- Sunil Shatagopa <sshatago@cisco.com>
3333
- Vivek Raj Penke <vpenke@cisco.com>
3434

35-
description: Ansible Modules for Cisco DNA Center
35+
description: "DEPRECATED - Use cisco.catalystcenter instead. Ansible Modules for Cisco DNA Center."
3636
license_file: "LICENSE"
3737
tags:
3838
- cisco

plugins/module_utils/dnac.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
DNAC_SDK_IS_INSTALLED = False
1818
else:
1919
DNAC_SDK_IS_INSTALLED = True
20-
from ansible.module_utils._text import to_native
20+
from ansible.module_utils.common.text.converters import to_native
2121
from ansible.module_utils.common import validation
2222
from abc import ABCMeta, abstractmethod
2323
try:
@@ -47,6 +47,11 @@ class DnacBase():
4747

4848
def __init__(self, module):
4949
self.module = module
50+
module.deprecate(
51+
msg="The cisco.dnac collection is deprecated. Please migrate to cisco.catalystcenter.",
52+
version="7.0.0",
53+
collection_name="cisco.dnac",
54+
)
5055
self.params = module.params
5156
self.config = copy.deepcopy(module.params.get("config"))
5257
self.have = {}

plugins/plugin_utils/dnac.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
else:
1515
DNAC_SDK_IS_INSTALLED = True
1616
from ansible.module_utils.basic import env_fallback
17-
from ansible.module_utils._text import to_native
17+
from ansible.module_utils.common.text.converters import to_native
18+
from ansible.utils.display import Display
19+
20+
display = Display()
1821

1922
try:
2023
import logging
@@ -182,6 +185,11 @@ def dnac_argument_spec():
182185

183186
class DNACSDK(object):
184187
def __init__(self, params):
188+
display.deprecated(
189+
"The cisco.dnac collection is deprecated. Please migrate to cisco.catalystcenter.",
190+
version="7.0.0",
191+
collection_name="cisco.dnac",
192+
)
185193
self.result = dict(changed=False, result="")
186194
self.validate_response_schema = params.get("validate_response_schema")
187195
if DNAC_SDK_IS_INSTALLED:

0 commit comments

Comments
 (0)