mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fixes usage of popen in bigip iapplx package (#41612)
This functionality is superceeded by the run_command method in the ansible module class.
This commit is contained in:
parent
5c614a59a6
commit
16466f3171
2 changed files with 5 additions and 6 deletions
|
@ -148,11 +148,10 @@ class Parameters(AnsibleF5Parameters):
|
|||
:return:
|
||||
"""
|
||||
cmd = ['rpm', '-qp', '--queryformat', '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}', self.package]
|
||||
p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
|
||||
stdout, stderr = p.communicate()
|
||||
if not stdout:
|
||||
rc, out, err = self._module.run_command(cmd)
|
||||
if not out:
|
||||
return str(self.package_file)
|
||||
return stdout.decode('utf-8')
|
||||
return out
|
||||
|
||||
@property
|
||||
def package_root(self):
|
||||
|
@ -177,7 +176,7 @@ class ModuleManager(object):
|
|||
def __init__(self, *args, **kwargs):
|
||||
self.module = kwargs.get('module', None)
|
||||
self.client = kwargs.get('client', None)
|
||||
self.want = Parameters(params=self.module.params)
|
||||
self.want = Parameters(module=self.module, params=self.module.params)
|
||||
self.changes = Parameters()
|
||||
|
||||
def exec_module(self):
|
||||
|
|
|
@ -84,7 +84,7 @@ class TestManager(unittest.TestCase):
|
|||
set_module_args(dict(
|
||||
content='fixtures/MyApp-0.1.0-0001.noarch.rpm',
|
||||
state='present',
|
||||
password='passsword',
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin'
|
||||
))
|
||||
|
|
Loading…
Reference in a new issue