diff --git a/lib/ansible/modules/network/f5/bigip_iapplx_package.py b/lib/ansible/modules/network/f5/bigip_iapplx_package.py index fde8a717b6..26ca18bdbb 100644 --- a/lib/ansible/modules/network/f5/bigip_iapplx_package.py +++ b/lib/ansible/modules/network/f5/bigip_iapplx_package.py @@ -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): diff --git a/test/units/modules/network/f5/test_bigip_iapplx_package.py b/test/units/modules/network/f5/test_bigip_iapplx_package.py index 05ed42a79b..181b5bde77 100644 --- a/test/units/modules/network/f5/test_bigip_iapplx_package.py +++ b/test/units/modules/network/f5/test_bigip_iapplx_package.py @@ -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' ))