From c193604f602e0cf4c44a7c02003f519fb35ddb15 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Wed, 12 Mar 2014 17:04:19 -0400 Subject: [PATCH] Some more run_command updates. --- library/packaging/portinstall | 6 +++--- library/source_control/bzr | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/library/packaging/portinstall b/library/packaging/portinstall index 4bef8035be3..711a853e34a 100644 --- a/library/packaging/portinstall +++ b/library/packaging/portinstall @@ -71,7 +71,7 @@ def query_package(module, name): if pkg_info_path: pkgng = False pkg_glob_path = module.get_bin_path('pkg_glob', True) - rc, out, err = module.run_command("%s -e `pkg_glob %s`" % (pkg_info_path, name)) + rc, out, err = module.run_command("%s -e `pkg_glob %s`" % (pkg_info_path, pipes.quote(name), use_unsafe_shell=True) else: pkgng = True pkg_info_path = module.get_bin_path('pkg', True) @@ -128,11 +128,11 @@ def remove_packages(module, packages): if not query_package(module, package): continue - rc, out, err = module.run_command("%s `%s %s`" % (pkg_delete_path, pkg_glob_path, package)) + rc, out, err = module.run_command("%s `%s %s`" % (pkg_delete_path, pkg_glob_path, pipes.quote(package)), use_unsafe_shell=True) if query_package(module, package): name_without_digits = re.sub('[0-9]', '', package) - rc, out, err = module.run_command("%s `%s %s`" % (pkg_delete_path, pkg_glob_path, name_without_digits)) + rc, out, err = module.run_command("%s `%s %s`" % (pkg_delete_path, pkg_glob_path, pipes.quote(lame_without_digits)),use_unsafe_shell=True) if query_package(module, package): module.fail_json(msg="failed to remove %s: %s" % (package, out)) diff --git a/library/source_control/bzr b/library/source_control/bzr index 5217e469900..996150a39af 100644 --- a/library/source_control/bzr +++ b/library/source_control/bzr @@ -76,8 +76,7 @@ class Bzr(object): self.bzr_path = bzr_path def _command(self, args_list, cwd=None, **kwargs): - (rc, out, err) = self.module.run_command( - [self.bzr_path] + args_list, cwd=cwd, **kwargs) + (rc, out, err) = self.module.run_command([self.bzr_path] + args_list, cwd=cwd, **kwargs) return (rc, out, err) def get_version(self):