mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 11:10:21 -07:00
pipx/pipx_info: add return value version (#9180)
* pipx/pipx_info: add return value version * add changelog frag
This commit is contained in:
parent
a3bd49c010
commit
a9449ccc2e
5 changed files with 46 additions and 18 deletions
|
@ -119,6 +119,13 @@ cmd:
|
|||
type: list
|
||||
elements: str
|
||||
sample: ["/usr/bin/python3.10", "-m", "pipx", "list", "--include-injected", "--json"]
|
||||
|
||||
version:
|
||||
description: Version of pipx.
|
||||
type: str
|
||||
returned: always
|
||||
sample: "1.7.1"
|
||||
version_added: 10.1.0
|
||||
"""
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.module_helper import ModuleHelper
|
||||
|
@ -149,6 +156,9 @@ class PipXInfo(ModuleHelper):
|
|||
facts = ansible_facts(self.module, gather_subset=['python'])
|
||||
self.command = [facts['python']['executable'], '-m', 'pipx']
|
||||
self.runner = pipx_runner(self.module, self.command)
|
||||
with self.runner("version") as ctx:
|
||||
rc, out, err = ctx.run()
|
||||
self.vars.version = out.strip()
|
||||
|
||||
def __run__(self):
|
||||
output_process = make_process_list(self, **self.vars.as_dict())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue