mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-03-22 05:09:12 +00:00
[PR #10689/cc41d9da backport][stable-11] gem: fix soundness issue when uninstalling default gems on Ubuntu (#10878)
gem: fix soundness issue when uninstalling default gems on Ubuntu (#10689)
* Attempt to fix gem soundness issue
* Return command execution
* Fix value error
* Attempt to fix failling tests
* Fix minor issues
* Update changelog
* Update tests/integration/targets/gem/tasks/main.yml
* Update changelogs/fragments/10689-gem-prevent-soundness-issue.yml
* Remove state and name from gem error message
* Improve gem uninstall check
* Make unit tests pass
* Fix linting issues
* gem: Remove length chenck and adapt unit tests
* Adapt gem unit tests
* gem: improve error msg
* Fix sanity error
* Fix linting issue
---------
(cherry picked from commit cc41d9da60)
Co-authored-by: Giorgos Drosos <56369797+gdrosos@users.noreply.github.com>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
5af8d6132d
commit
90850b3763
4 changed files with 38 additions and 8 deletions
|
|
@ -212,3 +212,18 @@
|
|||
that:
|
||||
- install_gem_result is changed
|
||||
- not gem_bindir_stat.stat.exists
|
||||
|
||||
- name: Attempt to uninstall default gem 'json'
|
||||
community.general.gem:
|
||||
name: json
|
||||
state: absent
|
||||
when: ansible_distribution == "Ubuntu"
|
||||
register: gem_result
|
||||
ignore_errors: true
|
||||
|
||||
- name: Assert gem uninstall failed as expected
|
||||
when: ansible_distribution == "Ubuntu"
|
||||
assert:
|
||||
that:
|
||||
- gem_result is failed
|
||||
- gem_result.msg.startswith("Failed to uninstall gem 'json'")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue