Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[master] Decode oscap byte stream to string #66234

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ycedres
Copy link
Contributor

@ycedres ycedres commented Mar 14, 2024

What does this PR do?

In the openscap module, we send non-escaped byte error stream from the oscap output to salt-master. However, the error stream may contain non-ascii characters, which Uyuni cannot process further. This means that user doesn't see any errors in the UI, just decoding exceptions in the logs.

Merge requirements satisfied?

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

Commits signed with GPG?

No

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

@twangboy twangboy self-assigned this Mar 14, 2024
Comment on lines +158 to +159
(_, error) = proc.communicate()
error = error.decode("ascii", errors="ignore")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If Salt is supposed to treat all output as text, and non binary output, then why not fix the subprocess call?

ret = subprocess.run(cmd_opts, capture_output=True, text=True)
error = ret.stderr

etc...

Copy link
Contributor

@dwoz dwoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This module is being removed from the master branch as a community maintained extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants