Skip to content

Change zypperpkg to only parse stdout from rpm#69503

Open
tacerus wants to merge 1 commit into
saltstack:3006.xfrom
tacerus:zypperpkg-rpm-out-3006
Open

Change zypperpkg to only parse stdout from rpm#69503
tacerus wants to merge 1 commit into
saltstack:3006.xfrom
tacerus:zypperpkg-rpm-out-3006

Conversation

@tacerus

@tacerus tacerus commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

If rpm on a system returns warnings on stderr, parsing would fail

...
    provide, realname = line.split("_|-")
ValueError: not enough values to unpack (expected 2, got 1)

and render related functions unusable.

Generally, query output to process should only be expected on stdout. Hence, solve the issue and ensure functionality regardless of warnings by discarding stderr.

What issues does this PR fix or reference?

Fixes #69502.

Previous Behavior

pkg states fail if rpm returns warnings.

New Behavior

pkg states work regardless of rpm returning warnings, matching native zypper behavior.

Merge requirements satisfied?

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

Commits signed with GPG?

Yes

If `rpm` on a system returns warnings on stderr, parsing would fail

```
...
    provide, realname = line.split("_|-")
ValueError: not enough values to unpack (expected 2, got 1)
```

and render related functions unusable.

Generally, query output to process should only be expected on stdout.
Hence, solve the issue and ensure functionality regardless of warnings
by discarding stderr.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
@tacerus tacerus marked this pull request as ready for review June 21, 2026 19:52
@tacerus tacerus requested a review from a team as a code owner June 21, 2026 19:52
@dwoz dwoz added the test:full Run the full test suite label Jun 21, 2026
@tacerus

tacerus commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Any help what's wrong with cmd.run_all in the few failing tests? It appears as if the MagicMock is not injecting it there.

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