From c2a4e230aa0f889b070abb6cbc5c87058cabe834 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 22 Oct 2015 18:47:35 -0500 Subject: [PATCH] More consistent use of run_command() wrapper function, which now adds the default binary location to the search path --- lib/ansible/modules/extras/packaging/os/pkgutil.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/ansible/modules/extras/packaging/os/pkgutil.py b/lib/ansible/modules/extras/packaging/os/pkgutil.py index 3a4720630cf..cb674b1453c 100644 --- a/lib/ansible/modules/extras/packaging/os/pkgutil.py +++ b/lib/ansible/modules/extras/packaging/os/pkgutil.py @@ -63,10 +63,10 @@ import os import pipes def package_installed(module, name): - cmd = [module.get_bin_path('pkginfo', True)] + cmd = ['pkginfo'] cmd.append('-q') cmd.append(name) - rc, out, err = module.run_command(' '.join(cmd)) + rc, out, err = run_command(module, cmd) if rc == 0: return True else: @@ -79,16 +79,16 @@ def package_latest(module, name, site): cmd += [ '-t', pipes.quote(site) ] cmd.append(pipes.quote(name)) cmd += [ '| tail -1 | grep -v SAME' ] - rc, out, err = module.run_command(' '.join(cmd), use_unsafe_shell=True) + rc, out, err = run_command(module, cmd, use_unsafe_shell=True) if rc == 1: return True else: return False -def run_command(module, cmd): +def run_command(module, cmd, **kwargs): progname = cmd[0] - cmd[0] = module.get_bin_path(progname, True) - return module.run_command(cmd) + cmd[0] = module.get_bin_path(progname, True, ['/opt/csw/bin']) + return module.run_command(cmd, **kwargs) def package_install(module, state, name, site): cmd = [ 'pkgutil', '-iy' ]