Merge pull request #7776 from toddmowen/pkgutil-quote-fix

Fix in pkgutil: don't call pipes.quote() on None
reviewable/pr18780/r1
James Cammarata 11 years ago
commit 4f1353bec1

@ -74,12 +74,10 @@ def package_installed(module, name):
def package_latest(module, name, site): def package_latest(module, name, site):
# Only supports one package # Only supports one package
name = pipes.quote(name)
site = pipes.quote(site)
cmd = [ 'pkgutil', '--single', '-c' ] cmd = [ 'pkgutil', '--single', '-c' ]
if site is not None: if site is not None:
cmd += [ '-t', site ] cmd += [ '-t', pipes.quote(site) ]
cmd.append(name) cmd.append(pipes.quote(name))
cmd += [ '| tail -1 | grep -v SAME' ] cmd += [ '| tail -1 | grep -v SAME' ]
rc, out, err = module.run_command(' '.join(cmd), use_unsafe_shell=True) rc, out, err = module.run_command(' '.join(cmd), use_unsafe_shell=True)
if rc == 1: if rc == 1:

Loading…
Cancel
Save