Skip to content

Conversation

notCalle
Copy link
Contributor

Pull Request (PR) description

The template for gunicorn configuration was using the legacy fact processorcount in the formula for its default worker count. This changes the default to use the processors.count fact instead.

Test coverage specifically for python::gunicorn is extended to the regular supported os facts, instead of a single subset of Debian-ish facts.

This Pull Request (PR) fixes the following issues

notCalle added 3 commits June 23, 2025 13:50
Given that legacy facts were removed from facterdb 3, the current
behavior relies on `NilClass#to_i` resolving to missing fact to 0.

The added test case for custom `workers` parameter given cannot give
false positives with the default formula always being an odd number.
While the documentation for the core fact `processors.count` states that
it is an _integer_ already, the previous behavior was to silently treat
a missing fact as a processor count of zero, via `NilClass#to_i`.

This does not happen in FacterDB entries for supported os, but the spec
still mirrors the conversion done by the template.
@kenyon kenyon added the bug Something isn't working label Jun 23, 2025
@kenyon kenyon merged commit ecb8d77 into voxpupuli:master Jun 23, 2025
28 checks passed
@notCalle notCalle deleted the gunicorn-legacy-facts branch June 24, 2025 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants