Open
Conversation
No functional changes in this commit. Run black and isort.
No functional changes in this commit. Run black and isort linters against MaintenanceMode.
No functional changes in this commit. Run black and isort linters against dcnm_maintenance_mode.py.
No functional changes in this commit. Run black and isort linters against unit test files for dcnm_maintenance_mode.
No functional changes in this commit. This commit updates all docstrings to conform to the standards defined in CLAUDE.md (not in this repository). These standards include: 1. Structured headings # Summary ## Raises ### ValueError ## Other heading …etc 2. Single backticks around class, method, var, names, exception names, etc.
Fix below error: ERROR: tests/unit/module_utils/common/test_maintenance_mode.py:1238:161: E501: line too long (181 > 160 characters)
Add type hints for all vars and type annotations for all methods.
Certain dcnm_maintenance_mode unit test asserts will fail due to the changes in the last commit. Fixing that in this commit.
No functional changes in this commit. 1. Update all docstrings to conform to Markdown format. 2. Add module dostrings where missing. 3. Add pylint supression directive for __metaclass__ invalid-name
No functional changes in this commit. Update copyright dates for all unit test files associuated with dcnm_maintenance_mode.
1. Suppress invalid-name for __metaclass__ 2. Add module docstring
1. Add type hints for dcnm_maintenance_mode module and support classes. 2. Replace class decorators for RestSend and Results with local properties. - plugins/module_utils/common/maintenance_mode.py - plugins/module_utils/common/maintenance_mode_info.py - plugins/modules/dcnm_maintenance_mode.py 3. Update unit tests for the above 4. Some unit tests related to verifying Results is set are removed since they are no longer needed given that Results is instantiated in class initializers. 5. Add enums for maintenance mode values (e.g, “normal” “maintenance”).
1. Add blank lines where linters prefer them. 2. Move import after DOCUMENTATION.
Use the standard fabric_type and fabric_name numbering, e.g.: fabric_name_00 - VXLAN_EVPN fabric_type_00 - VXLAN_EVPN
…-mode-integration-tests
# Summary This commit replaces Results (v1) with Results (v2) in the dcnm_maintenance_mode module and its supporting libraries. This is made possible by leveraging SwitchDetails (v2). ## Files changed 1. plugins/modules/dcnm_maintenance_mode.py 1a. Replace results import with results_v2 1b. Update results.changed call to use v2’s results.add_changed() 1c. Update results.failed call to use v2’s results.add_failed() 2. plugins/module_utils/common/maintenance_mode.py 2a. Replace results import with results_v2 2b. import OperationType used by Results (v2) 2c. Instantiate Results in __init__() 2d. Set results.operation_type in the results.setter 2e. Add type hints where missing 2f. Modify several item.get() calls to default to “” to match the target var’s type. 3. plugins/module_utils/common/maintenance_mode_info.py 3a. Remove TODOs associated with SwitchDetails and Results after addressing them. 3b. Replace switch_details import with switch_details_v2 3c. Replace results import with results_v2 3d. Update results instantiation in _init__ 3e. Add type hints where missing 3f. Update conditionals to accommodate differences in return values from SwitchDetails (v2) vs v1.
1. tests/modules/dcnm/dcnm_bootflash/test_bootflash_files.py 1a. Modify imports results -> results_v2 switch_details -> switch_details_v2 2. plugins/module_utils/bootflash/bootflash_files.py 2a. Modify imports results -> results_v2 switch_details -> switch_details_v2 2b. __init__(): Remove switch_details.rest_send call 2c. Use private vars throughout self.rest_send -> self._rest_send self.results -> self._results 2d. Remove pylint suppression directives for no-member 2e. Move validation of rest_send.params from getter to setter.
1. plugins/module_utils/bootflash/bootflash_info.py 1a. Replace Results (v1) with Results (v2) and SwitchDetails (v1) with SwitchDetails (v2) results -> results_v2 switch_details -> switch_details_v2 2. tests/unit/modules/dcnm/dcnm_bootflash/test_bootflash_info.py 2a. Replace Results (v1) with Results (v2) and SwitchDetails (v1) with SwitchDetails (v2) results -> results_v2 switch_details -> switch_details_v2 2b. test_bootflash_info_00110 Modify assert match to expect error from validate_refresh_parameters rather than from rest_send.
1. plugins/modules/dcnm_bootflash.py 1a. Replace results with results_v2 1b. Replace switch_details with switch_details_v2
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request migrates dcnm_bootflash and dcnm_maintenance_mode modules from Results (v1) to Results (v2) and SwitchDetails (v1) to SwitchDetails (v2). The changes include:
- Updating import statements to use v2 versions of Results and SwitchDetails classes
- Updating unit test files to align with the v2 versions of Results and SwitchDetails classes
Reviewed changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| plugins/modules/dcnm_bootflash.py | Updated imports from v1 to v2 for Results and SwitchDetails |
| plugins/modules/dcnm_maintenance_mode.py | Added type annotations, updated docstrings, added rest_send/results property setters |
| plugins/module_utils/common/maintenance_mode.py | Added type annotations, property setters for rest_send/results, removed Properties decorator |
| plugins/module_utils/common/maintenance_mode_info.py | Added type annotations, property setters, updated to use v2 classes |
| plugins/module_utils/common/enums.py | New file defining MaintenanceModeSetEnum and MaintenanceModeGetEnum |
| tests/unit/modules/dcnm/dcnm_bootflash/test_bootflash_info.py | Updated imports and test assertions for v2 API |
| tests/unit/modules/dcnm/dcnm_bootflash/test_bootflash_files.py | Updated imports to use v2 classes |
| tests/unit/module_utils/common/test_maintenance_mode.py | Updated test assertions for private properties |
| tests/unit/module_utils/common/test_maintenance_mode_info.py | Updated test assertions and added type: ignore comments |
| tests/unit/modules/dcnm/dcnm_maintenance_mode/*.py | Updated docstrings, test assertions, and removed unnecessary setup code |
| tests/integration/targets/dcnm_maintenance_mode/tests/*.yaml | Updated fabric name variables for consistency |
| tests/unit/modules/dcnm/dcnm_maintenance_mode/utils.py | Added module docstring and updated formatting |
| tests/unit/module_utils/common/common_utils.py | Added module docstring |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/unit/modules/dcnm/dcnm_maintenance_mode/test_dcnm_maintenance_mode_common.py
Show resolved
Hide resolved
1. tests/unit/modules/dcnm/dcnm_bootflash/test_bootflash_deleted.py Change the following imports. results -> results_v2 switch_details -> switch_details_v2
This was referenced Dec 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR replaces Results (v1) with Results (v2) and SwitchDetails (v1) with SwitchDetails (v2) for all files related to dcnm_bootflash.
Notes to reviewers
Files changed
1. plugins/modules/dcnm_bootflash.py
1a. Replace results with results_v2
1b. Replace switch_details with switch_details_v2
2. plugins/module_utils/bootflash/bootflash_files.py
2a. Modify imports
results -> results_v2
switch_details -> switch_details_v2
2b. init(): Remove switch_details.rest_send call
2c. Use private vars throughout
self.rest_send -> self._rest_send
self.results -> self._results
2d. Remove pylint suppression directives for no-member
2e. Move validation of rest_send.params from getter to setter.
3. plugins/module_utils/bootflash/bootflash_info.py
3a. Replace Results (v1) with Results (v2) and SwitchDetails (v1) with SwitchDetails (v2)
results -> results_v2
switch_details -> switch_details_v2
4 tests/unit/modules/dcnm/dcnm_bootflash/test_bootflash_deleted.py
4a. Replace Results (v1) with Results (v2) and SwitchDetails (v1) with SwitchDetails (v2)
results -> results_v2
switch_details -> switch_details_v2
5. tests/unit/modules/dcnm/dcnm_bootflash/test_bootflash_info.py
5a. Replace Results (v1) with Results (v2) and SwitchDetails (v1) with SwitchDetails (v2)
results -> results_v2
switch_details -> switch_details_v2
5b. test_bootflash_info_00110
Modify assert match to expect error from validate_refresh_parameters rather than from rest_send.
6. tests/modules/dcnm/dcnm_bootflash/test_bootflash_files.py
6a. Modify imports
results -> results_v2
switch_details -> switch_details_v2