Skip to content

debpkg include 0/1 as valid options when parsing bool values in deb822#68997

Merged
dwoz merged 5 commits into
saltstack:3008.xfrom
Sxderp:pr-fix-deb822-bool-parsing
May 27, 2026
Merged

debpkg include 0/1 as valid options when parsing bool values in deb822#68997
dwoz merged 5 commits into
saltstack:3008.xfrom
Sxderp:pr-fix-deb822-bool-parsing

Conversation

@Sxderp
Copy link
Copy Markdown
Contributor

@Sxderp Sxderp commented Apr 24, 2026

What does this PR do?

What issues does this PR fix or reference?

Fixes #68996

Previous Behavior

Stacktrace occurred when a deb file was parsed when "0" or "1" were used as False / True

New Behavior

Stacktrace no longer occurs

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes/No

@dwoz
Copy link
Copy Markdown
Contributor

dwoz commented Apr 28, 2026

@Sxderp Please rebase

@Sxderp
Copy link
Copy Markdown
Contributor Author

Sxderp commented May 13, 2026

@dwoz I'm actually having a bit of trouble figuring out how to fix my code and I hope I could get some assistance.

The issue.

In the test file there are three fixtures that create a "repo" file for use:

  • deb822_repo_file (pre-existing fixture)
  • deb822_repo_bool_false_file (fixture added by me)
  • deb822_repo_bool_true_file (fixture added by me)

When I define my test functions I specifically use the new fixture:

def test_get_repo_deb822_with_false(
    deb822_repo_bool_false_file: pathlib.Path, mock_apt_config
):
    ...

However, when the test is ran the the existing fixture and my new fixture are BOTH invoked (I added some bugging print statements).

$ nox -- tests/pytests/unit/modules/test_aptpkg.py::test_get_repo_deb822_with_false
...                                                                                                                                                                   

tests/pytests/unit/modules/test_aptpkg.py::test_get_repo_deb822_with_false[no]
running from deb822_repo_bool_false_file
running from deb822_repo_file
FAILED

Can you point to what I'm doing wrong? How do I prevent the deb822_repo_file fixture from running?

@Sxderp
Copy link
Copy Markdown
Contributor Author

Sxderp commented May 14, 2026

I believe I figured out a solution. I'm not sure it's the best, but the tests are now passing (locally).

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.

2 participants