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

[Feature Request][zypper] Add parameter to simplify/reduce error output #8416

Closed
1 task done
erichoog opened this issue May 25, 2024 · 5 comments · Fixed by #9270
Closed
1 task done

[Feature Request][zypper] Add parameter to simplify/reduce error output #8416

erichoog opened this issue May 25, 2024 · 5 comments · Fixed by #9270
Labels
feature This issue/PR relates to a feature request module module plugins plugin (any type)

Comments

@erichoog
Copy link
Contributor

erichoog commented May 25, 2024

Summary

This is a feature request for the zypper module:

  • When updating all system packages using this module and the task fails due to underlying OS issues(disk space).
  • Massive XML dump on failure is hard to parse through to pick out relevant error messages
  • Request to add option to parse only <message> tags in output on failure

Issue Details

When patching many systems with the zypper module we occasionally hit an issue where installing packages fails due to lack of free space on the client machines.

There are often many packages to be updated and when these failures occur there is alot of xml output from zypper (and the module) to parse through. This makes it harder to pick out the actual error message from the output.

Generally on a failure like this, only the text in the <message> tags are relevant instead of the entire xml output.

Proposed Solution

Ideally we could pass a parameter like simple_errors: true to the module and it would only dump the text in the <message> tags on failure instead of the entire xml output.

I have written some code for this but haven't contributed here before. Please let me know if this is something that others might be interested in.

Issue Type

Feature Idea

Component Name

zypper

Additional Information

Adding simple_errors: true would ensure only text from <message> tags are dumped to stout instead of the entire xml output on failure:

- name: Apply all available patches
  community.general.zypper:
    name: '*'
    state: latest
    type: patch
    simple_errors: true

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added feature This issue/PR relates to a feature request module module plugins plugin (any type) labels May 25, 2024
@erichoog
Copy link
Contributor Author

erichoog commented Sep 3, 2024

I could submit a PR for this if welcomed.

@felixfontein
Copy link
Collaborator

I think that should be ok!

@erichoog
Copy link
Contributor Author

I will try and get a PR submitted this week for this.

erichoog pushed a commit to erichoog/community.general that referenced this issue Dec 17, 2024
erichoog pushed a commit to erichoog/community.general that referenced this issue Dec 23, 2024
felixfontein pushed a commit to erichoog/community.general that referenced this issue Dec 23, 2024
felixfontein added a commit that referenced this issue Dec 25, 2024
* zypper: add simple_errors option -fixes #8416

* Fix style issues

* Apply suggestions from code review

Co-authored-by: Felix Fontein <[email protected]>

* Fix indentation

* Add changelog fragment

* Apply suggestions from code review

Co-authored-by: Felix Fontein <[email protected]>

* Updated as per code review recommendations

* Fix whitespace

* Add quiet option, fix logic, update changelog

* Fix trailing whitespace

* Update plugins/modules/zypper.py

Co-authored-by: Felix Fontein <[email protected]>

* Add suggested improvements

---------

Co-authored-by: Eric Hoogeveen <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
patchback bot pushed a commit that referenced this issue Dec 25, 2024
* zypper: add simple_errors option -fixes #8416

* Fix style issues

* Apply suggestions from code review

Co-authored-by: Felix Fontein <[email protected]>

* Fix indentation

* Add changelog fragment

* Apply suggestions from code review

Co-authored-by: Felix Fontein <[email protected]>

* Updated as per code review recommendations

* Fix whitespace

* Add quiet option, fix logic, update changelog

* Fix trailing whitespace

* Update plugins/modules/zypper.py

Co-authored-by: Felix Fontein <[email protected]>

* Add suggested improvements

---------

Co-authored-by: Eric Hoogeveen <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 825e0ee)
felixfontein pushed a commit that referenced this issue Dec 25, 2024
…ion - fixes #8416 (#9370)

zypper: add simple_errors option - fixes #8416 (#9270)

* zypper: add simple_errors option -fixes #8416

* Fix style issues

* Apply suggestions from code review

Co-authored-by: Felix Fontein <[email protected]>

* Fix indentation

* Add changelog fragment

* Apply suggestions from code review

Co-authored-by: Felix Fontein <[email protected]>

* Updated as per code review recommendations

* Fix whitespace

* Add quiet option, fix logic, update changelog

* Fix trailing whitespace

* Update plugins/modules/zypper.py

Co-authored-by: Felix Fontein <[email protected]>

* Add suggested improvements

---------

Co-authored-by: Eric Hoogeveen <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 825e0ee)

Co-authored-by: Eric <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue/PR relates to a feature request module module plugins plugin (any type)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants