Skip to content

Fix poudriere jail functions for purely numeric jail names#69772

Merged
dwoz merged 1 commit into
saltstack:3006.xfrom
ggiesen:fix-61082
Jul 12, 2026
Merged

Fix poudriere jail functions for purely numeric jail names#69772
dwoz merged 1 commit into
saltstack:3006.xfrom
ggiesen:fix-61082

Conversation

@ggiesen

@ggiesen ggiesen commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

poudriere.is_jail compared the parsed jail-name token (always a string) directly against the name argument. When a jail name is purely numeric, the salt CLI YAML-parses the positional argument into an int, so a str == int comparison is always False and the jail is never found. This coerces name to a string before the comparison.

Because is_jail gates create_jail, update_jail, delete_jail, info_jail, and bulk_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:

# salt-call poudriere.is_jail 13
local:
    False
# salt-call poudriere.delete_jail 12
local:
    Looks like jail 12 has not been created

while forcing the argument to a string worked:

# salt-call poudriere.is_jail "'13'"
local:
    True

New Behavior

Numeric jail names are matched correctly, so is_jail, delete_jail, create_jail, update_jail, info_jail, and bulk_build work with digit-only jail names. Existing string names (including numeric-prefixed ones like 13-arm-oncourse) are unaffected because str() is idempotent on strings.

Merge requirements satisfied?

  • Docs: n/a (behavioural bugfix, no doc change needed)
  • Changelog entry added (changelog/61082.fixed.md)
  • Tests written and passing: test_is_jail_numeric_61082 (int-input reproducer), test_is_jail_numeric_absent_61082 (numeric non-match must-not-regress), and test_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

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
@ggiesen ggiesen requested a review from a team as a code owner July 10, 2026 17:56
@charzl charzl self-assigned this Jul 10, 2026
@dwoz dwoz added the test:full Run the full test suite label Jul 10, 2026
@dwoz dwoz merged commit 513074d into saltstack:3006.x Jul 12, 2026
510 of 515 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants