From d95eddceb1465514929e3a3fcaa344db3d56cb17 Mon Sep 17 00:00:00 2001 From: Sebastien Bocahu Date: Mon, 13 Aug 2012 19:36:08 +0200 Subject: [PATCH] Quote the repository string when appending it to the command line in the apt_repository module. --- library/apt_repository | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/apt_repository b/library/apt_repository index b495b7fed1..8724f7c301 100755 --- a/library/apt_repository +++ b/library/apt_repository @@ -61,7 +61,7 @@ def main(): repo = module.params['repo'] state = module.params['state'] - rc, out, err = _run('%s %s --remove' % (add_apt_repository, repo)) + rc, out, err = _run('%s "%s" --remove' % (add_apt_repository, repo)) existed = 'Error' not in out if state == 'absent': @@ -70,7 +70,7 @@ def main(): else: module.exit_json(changed=True, repo=repo, state=state) - cmd = '%s %s' % (add_apt_repository, repo) + cmd = '%s "%s"' % (add_apt_repository, repo) if platform.dist()[0] == 'debian' or float(platform.dist()[1]) >= 11.10: cmd = cmd + ' -y'