From 22284188fb43f6a053ed1f2e9496bcda028413f4 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Tue, 12 Dec 2017 22:01:32 +0000 Subject: [PATCH] Quote arguments to the test command When testing to see whether the installed subunit2sql package matches the version available on PyPI, the first argument can be empty if the package has not yet been installed. Make sure these arguments are quoted so that the test command gets a syntax it can parse (rather than a string starting with a binary operator). Change-Id: Ia2e7165f851085328e00431a739cce17d2e494b2 --- manifests/init.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index fdf2666..e05426e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -50,7 +50,7 @@ class subunit2sql ( # deps we've preinstalled from system packages because they lack wheels on # PyPI and must be otherwise rebuilt from sdist instead (specifically # netifaces). - onlyif => '/bin/bash -c "test $(pip list --format columns | sed -ne \'s/^subunit2sql\s\+\(.*\)$/\1/p\') != $(pip search \'subunit2sql$\' | sed -ne \'s/^subunit2sql (\(.*\)).*$/\1/p\')"', + onlyif => '/bin/bash -c "test \\"$(pip list --format columns | sed -ne \'s/^subunit2sql\s\+\(.*\)$/\1/p\')\\" != \\"$(pip search \'subunit2sql$\' | sed -ne \'s/^subunit2sql (\(.*\)).*$/\1/p\')\\""', require => [ Class['pip'], Package['python-mysqldb'],