mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-03-22 05:09:12 +00:00
pipx/pipx_info: multiple fixes (#9044)
* pipx_info: factored process_list out * pipx_info: no need to pass param to _list * pipx_info: minor adjustment * pipx mod utils: make_process_list parameters * fix test for state=install_all * fix assertions * pipx tests: fix detection of pipx 1.7.0 * pipx: use make_process_output * add testcase * pipx: remove import json * pinned in pipx list is not always there * Update plugins/modules/pipx_info.py Co-authored-by: Felix Fontein <felix@fontein.de> * remove ensurepath and --user from pipx install * add changelog frag * Update changelogs/fragments/9044-pipx-fixes.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update changelogs/fragments/9044-pipx-fixes.yml * Update changelogs/fragments/9044-pipx-fixes.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update changelogs/fragments/9044-pipx-fixes.yml Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
c8410a924e
commit
2429e228a4
12 changed files with 165 additions and 176 deletions
|
|
@ -24,10 +24,39 @@
|
|||
- pycowsay
|
||||
register: uninstall_all_1
|
||||
|
||||
- name: Install pycowsay and black
|
||||
community.general.pipx:
|
||||
state: install
|
||||
name: "{{ item }}"
|
||||
loop:
|
||||
- black
|
||||
- pycowsay
|
||||
register: install_all_1
|
||||
|
||||
- name: Generate JSON spec
|
||||
community.general.pipx_info:
|
||||
include_raw: true
|
||||
register: pipx_list
|
||||
|
||||
- name: Copy content
|
||||
ansible.builtin.copy:
|
||||
content: "{{ pipx_list.raw_output }}"
|
||||
dest: "{{ remote_tmp_dir }}/spec.json"
|
||||
mode: "0644"
|
||||
|
||||
- name: Uninstall pycowsay and black (again)
|
||||
community.general.pipx:
|
||||
state: uninstall
|
||||
name: "{{ item }}"
|
||||
loop:
|
||||
- black
|
||||
- pycowsay
|
||||
register: uninstall_all_2
|
||||
|
||||
- name: Use install-all
|
||||
community.general.pipx:
|
||||
state: install-all
|
||||
spec_metadata: spec.json
|
||||
state: install_all
|
||||
spec_metadata: "{{ remote_tmp_dir }}/spec.json"
|
||||
register: install_all
|
||||
|
||||
- name: Run pycowsay (should succeed)
|
||||
|
|
@ -47,13 +76,14 @@
|
|||
loop:
|
||||
- black
|
||||
- pycowsay
|
||||
register: uninstall_all_2
|
||||
register: uninstall_all_3
|
||||
|
||||
- name: Assert uninstall-all
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- uninstall_all_1 is not changed
|
||||
- install_all_1 is changed
|
||||
- uninstall_all_2 is changed
|
||||
- install_all is changed
|
||||
- "'Moooooooo!' in what_the_cow_said.stdout"
|
||||
- "'/usr/local/bin/pycowsay' in which_cow.stdout"
|
||||
- uninstall_all_2 is changed
|
||||
- uninstall_all_3 is changed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue