mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-18 09:51:41 +00:00
pipx, pipx_info: refactor (#11640)
* pipx, pipx_info: refactor * add changelog frag
This commit is contained in:
parent
8568594453
commit
bc98b2aa3b
4 changed files with 21 additions and 24 deletions
|
|
@ -130,8 +130,6 @@ version:
|
|||
version_added: 10.1.0
|
||||
"""
|
||||
|
||||
from ansible.module_utils.facts.compat import ansible_facts
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.module_helper import ModuleHelper
|
||||
from ansible_collections.community.general.plugins.module_utils.pipx import (
|
||||
make_process_dict,
|
||||
|
|
@ -156,12 +154,7 @@ class PipXInfo(ModuleHelper):
|
|||
)
|
||||
|
||||
def __init_module__(self):
|
||||
if self.vars.executable:
|
||||
self.command = [self.vars.executable]
|
||||
else:
|
||||
facts = ansible_facts(self.module, gather_subset=["python"])
|
||||
self.command = [facts["python"]["executable"], "-m", "pipx"]
|
||||
self.runner = pipx_runner(self.module, self.command)
|
||||
self.runner = pipx_runner(self.module, self.vars.executable)
|
||||
with self.runner("version") as ctx:
|
||||
rc, out, err = ctx.run()
|
||||
self.vars.version = out.strip()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue