Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup of HTTP_Codes #605

Merged
merged 4 commits into from
Jun 6, 2024
Merged

Cleanup of HTTP_Codes #605

merged 4 commits into from
Jun 6, 2024

Conversation

Max-checkmk
Copy link
Contributor

Pull request type

Please 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 (please describe):

What is the current behavior?

  • A lot of modules overwrite the generic HTTP-Codes in utils.py with very similar or even equal ones

What is the new behavior?

  • module utils got updated with more HTTP-Codes and other ones have been updated
  • Removed a lot of redundant HTTP-Codes in the modules
  • Changed the fetch-function in the api so it works also without any additional http-codes

Other information

Some modules use extra http-codes that are adapted to the module (e.g. 200 - "Folder created" in the module folder).
Maybe we should discuss, if either other modules should use customized messages too.
As example for the bakery: "200: Agents have been baked" instead of "200: OK: The operation was done successfully"
Or we use also the generic version in other modules.

First one would end up in more code to take care of, but is nicer to read.

@Max-checkmk Max-checkmk added module:discovery This affects the discovery module module:tag_group This affects the tag_group module module:passwords This affects the passwords module module:bakery This affects the bakery module module:timeperiod This affects the timeperiod module labels May 24, 2024
@Max-checkmk Max-checkmk self-assigned this May 24, 2024
Copy link
Contributor

@lgetwan lgetwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that idea. :-)
There's only a minor change request from my side.

plugins/module_utils/api.py Show resolved Hide resolved
@Max-checkmk Max-checkmk requested a review from lgetwan May 31, 2024 08:28
@robin-checkmk robin-checkmk merged commit 15b5b4b into devel Jun 6, 2024
88 of 107 checks passed
@robin-checkmk robin-checkmk deleted the Cleanup-HTTP_Codes branch June 6, 2024 11:19
@github-actions github-actions bot locked and limited conversation to collaborators Jun 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
module:bakery This affects the bakery module module:discovery This affects the discovery module module:password module:passwords This affects the passwords module module:tag_group This affects the tag_group module module:timeperiod This affects the timeperiod module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants