Skip to content

Conversation

@0-wiz-0
Copy link
Contributor

@0-wiz-0 0-wiz-0 commented Dec 6, 2025

Issue

When running the included Python server for collectd-web, there are lots of errors like this in the log (i.e. on stdout);

127.0.0.1 - - [06/Dec/2025 22:02:29] CGI script exit code 1

These are not needed or wanted, since in all three cases the code was executed successfully.

Description

Make the CGI script return 0 instead of 1, which is interpreted as an error.

Checklist

Yes - and noticed that the link is broken and should be https://github.com/httpdss/collectd-web/blob/master/.github/CONTRIBUTING.md instead.

  • My code follows the code style of this project.
  • I have performed a self-review of my own code.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have updated the documentation accordingly.

Screenshots (if applicable)

Additional Comments

@0-wiz-0 0-wiz-0 requested a review from httpdss as a code owner December 6, 2025 21:44
@httpdss httpdss requested a review from Copilot December 11, 2025 18:34
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes incorrect exit codes in three CGI script functions. The functions were returning 1 (indicating error) in success cases, which caused spurious error log messages when using the Python server.

Key Changes:

  • Changed return values from 1 to 0 for successful execution in CGI handler functions
  • Affects three JSON response functions: list_hosts_json, action_show_host_json, and action_show_plugin_json

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@httpdss httpdss added the minor label Dec 11, 2025
@httpdss httpdss merged commit 2a873c4 into httpdss:master Dec 11, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants