Fix poudriere jail functions for purely numeric jail names#69772
Merged
Conversation
is_jail compared the parsed jail token (always a str) against the name argument. The salt CLI YAML-parses a numeric positional argument into an int, so is_jail never matched purely numeric jail names, breaking every caller that gates on it (create_jail, update_jail, delete_jail, info_jail, bulk_build). Coerce the name to a string before comparing. Fixes saltstack#61082
dwoz
approved these changes
Jul 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
poudriere.is_jailcompared the parsed jail-name token (always a string) directly against thenameargument. When a jail name is purely numeric, the salt CLI YAML-parses the positional argument into anint, so astr == intcomparison is alwaysFalseand the jail is never found. This coercesnameto a string before the comparison.Because
is_jailgatescreate_jail,update_jail,delete_jail,info_jail, andbulk_build, this single fix repairs all of them for numeric jail names.Note: the poudriere execution module lives in core only on the 3006.x branch (it was moved to a community saltext for 3008+), so this PR targets 3006.x.
What issues does this PR fix or reference?
Fixes #61082
Previous Behavior
A jail whose name is only digits could not be matched:
while forcing the argument to a string worked:
New Behavior
Numeric jail names are matched correctly, so
is_jail,delete_jail,create_jail,update_jail,info_jail, andbulk_buildwork with digit-only jail names. Existing string names (including numeric-prefixed ones like13-arm-oncourse) are unaffected becausestr()is idempotent on strings.Merge requirements satisfied?
changelog/61082.fixed.md)test_is_jail_numeric_61082(int-input reproducer),test_is_jail_numeric_absent_61082(numeric non-match must-not-regress), andtest_is_jail_numeric_prefixed_string_61082(string names still match)[NOTICE] Bug fixes or features added to Salt require tests.
Commits signed with GPG: No