Skip to content

Fix serveral issues with the DCD module - #1094

Draft
robin-checkmk wants to merge 2 commits into
develfrom
fix/serveral-issues-dcd
Draft

Fix serveral issues with the DCD module#1094
robin-checkmk wants to merge 2 commits into
develfrom
fix/serveral-issues-dcd

Conversation

@robin-checkmk

@robin-checkmk robin-checkmk commented May 15, 2026

Copy link
Copy Markdown
Member

Pull request type

Try to limit your pull request to one type, submit multiple pull requests if needed.

Check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build related changes
  • Documentation content changes
  • Other (describe what kind of change you performed):

What is the current behavior?

Describe the current behavior that you are modifying, or link to a relevant issue.

Four concrete issues:

  1. Bug — logger.set_loglevel(2) (line 590): immediately overrides logger.set_loglevel(module._verbosity) on line 589, so verbosity is always hardcoded to 2 regardless of -v flags. Leftover
    debug line.
  2. DCDHTTPCodes class: an unnecessary class wrapping plain dicts. dcd_metricbackend.py uses module-level HTTP_CODES_* dicts directly — cleaner and consistent with the rest of the
    collection.
  3. Multi-line docstrings on every method: violates the no-comments convention we follow. They describe what the code does, not why, and are redundant given well-named identifiers. All of
    it should be removed.
  4. except Exception as e in run_module: catches everything including programming errors, masking real bugs. dcd_metricbackend.py has no such catch. Should be removed.

Minor/secondary: json.JSONDecodeError (line 404) should be (ValueError, TypeError) for consistency; and the stale # Is this necessary? comment on line 576 should be resolved (the answer is
no — base_argument_spec() already handles this, and the required_if there just duplicates what Ansible enforces via api_auth_type).

The bug 1 is the only one with runtime impact.

What is the new behavior?

Describe the behavior or changes that are being added by this PR.

The above issues have been fixed.

Other information

Any other information that is important to this PR, e.g screenshots of how the component looks before and after the change.

@robin-checkmk robin-checkmk self-assigned this May 15, 2026
@robin-checkmk
robin-checkmk changed the base branch from main to devel May 15, 2026 11:07
@github-actions github-actions Bot added documentation Improvements or additions to documentation role:server This affects the server role role:agent This affects the agent role module:dcd This affects the dcd module. labels May 15, 2026
@github-actions

Copy link
Copy Markdown

This pull request has been stale for 60 days. It will close in 7 days.

@github-actions github-actions Bot added the stale Stale issues and pull requests. label Jul 15, 2026
@robin-checkmk
robin-checkmk force-pushed the fix/serveral-issues-dcd branch from f36f24d to e398efc Compare July 15, 2026 05:57
@robin-checkmk robin-checkmk removed the stale Stale issues and pull requests. label Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation module:dcd This affects the dcd module. role:agent This affects the agent role role:server This affects the server role

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant