Skip to content

Conversation

@allenrobel
Copy link
Collaborator

@allenrobel allenrobel commented Dec 6, 2025

Summary

This PR changes the following.

  1. Adds type hints and method annotations for the dcnm_maintenance_mode module and its support classes.

  2. Removes class decorators for RestSend and Results in favor of local properties for these classes (mypy does not understand the class decorator approach).

  3. Updates unit tests to align with the above changes.

Notes to reviewers

  • We understand this PR is a lower-priority item than linting for Redhat recertification, MCFG, etc.

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”).
@allenrobel allenrobel self-assigned this Dec 6, 2025
@allenrobel allenrobel added the Work in Progress Code not ready for review. label Dec 6, 2025
1. Add blank lines where linters prefer them.

2. Move import after DOCUMENTATION.
@allenrobel allenrobel added ready for review PR is ready to be reviewed and removed Work in Progress Code not ready for review. labels Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review PR is ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants