Skip to content

Commit e4258cf

Browse files
committed
fix: resolve sanity test failures for inventory plugin
- Remove unsupported plugin_type key from DOCUMENTATION block - Remove unused imports (math, os, PropertyMock, _NETWORK_OS_MAP, _SPECIAL_CHAR_MAP) - Replace unnecessary lambda with direct method reference - Add missing changelogs/config.yaml for antsibull-changelog
1 parent 5b4d5c2 commit e4258cf

3 files changed

Lines changed: 31 additions & 7 deletions

File tree

changelogs/config.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
changelog_filename_template: CHANGELOG.rst
3+
changelog_filename_version_depth: 0
4+
changes_file: changelog.yaml
5+
changes_format: combined
6+
keep_fragments: false
7+
notes_dir: fragments
8+
prelude_section_name: release_summary
9+
prelude_section_title: Release Summary
10+
sanitize_changelog: true
11+
sections:
12+
- - major_changes
13+
- Major Changes
14+
- - minor_changes
15+
- Minor Changes
16+
- - breaking_changes
17+
- Breaking Changes / Porting Guide
18+
- - deprecated_features
19+
- Deprecated Features
20+
- - removed_features
21+
- Removed Features (previously deprecated)
22+
- - security_fixes
23+
- Security Fixes
24+
- - bugfixes
25+
- Bugfixes
26+
- - known_issues
27+
- Known Issues
28+
title: cisco.catalystcenter
29+
trivial_section_name: trivial

plugins/inventory/catalystcenter.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
DOCUMENTATION = r"""
1111
name: catalystcenter
12-
plugin_type: inventory
1312
short_description: Cisco Catalyst Center dynamic inventory plugin
1413
description:
1514
- Queries Cisco Catalyst Center for network devices and builds an Ansible inventory.
@@ -201,7 +200,6 @@
201200
cache_connection: /tmp/catalystcenter_inventory_cache
202201
"""
203202

204-
import math
205203
import re
206204

207205
from ansible.errors import AnsibleError, AnsibleParserError

tests/unit/plugins/inventory/test_catalystcenter.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,15 @@
77

88
__metaclass__ = type
99

10-
import os
1110
import pytest
1211

13-
from unittest.mock import MagicMock, patch, PropertyMock
12+
from unittest.mock import MagicMock, patch
1413

1514
from ansible.inventory.data import InventoryData
1615
from ansible.parsing.dataloader import DataLoader
1716

1817
from ansible_collections.cisco.catalystcenter.plugins.inventory.catalystcenter import (
1918
InventoryModule,
20-
_NETWORK_OS_MAP,
21-
_SPECIAL_CHAR_MAP,
2219
)
2320

2421

@@ -60,7 +57,7 @@ def _set_options(plugin, **kwargs):
6057
}
6158
defaults.update(kwargs)
6259
plugin._options = defaults
63-
plugin.get_option = lambda key: plugin._options.get(key)
60+
plugin.get_option = plugin._options.get
6461

6562

6663
def _make_device(**overrides):

0 commit comments

Comments
 (0)