summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColleen Murphy <colleen.murphy@suse.de>2018-07-10 13:51:34 +0200
committerColleen Murphy <colleen.murphy@suse.de>2018-08-06 22:04:45 +0200
commit8360c894dbaccb4bffd082a3f9acc3bba5ee732f (patch)
tree83e9e306ba78a3d4b178ae7e125ebd2942cd6a51
parent2d4e2178fe356824200a6108360f4abe10fdcc68 (diff)
Fix subunit2sql install guard for idempotency
The exec to install subunit2sql tries to compare the output of pip list versus pip search to determine whether it is on the latest version. Without this patch, the pip list command produces a string that has too many spaces on the end and therefore doesn't match the result of the pip search command. This means that it will always try to reinstall subunit2sql even when it doesn't need to, which breaks idempotency tests. This patch fixes the regex group to exclude trailing spaces. Change-Id: I92f614db2da936d68d8f2305b348c65ba773b01c
Notes
Notes (review): Code-Review+2: Clark Boylan <cboylan@sapwetik.org> Code-Review+1: wangqi <wang.qi@99cloud.net> Code-Review+2: Ian Wienand <iwienand@redhat.com> Workflow+1: Ian Wienand <iwienand@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Wed, 21 Nov 2018 22:49:11 +0000 Reviewed-on: https://review.openstack.org/581335 Project: openstack-infra/puppet-subunit2sql Branch: refs/heads/master
-rw-r--r--manifests/init.pp2
1 files changed, 1 insertions, 1 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 8bc2042..31cdd05 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -50,7 +50,7 @@ class subunit2sql (
50 # deps we've preinstalled from system packages because they lack wheels on 50 # deps we've preinstalled from system packages because they lack wheels on
51 # PyPI and must be otherwise rebuilt from sdist instead (specifically 51 # PyPI and must be otherwise rebuilt from sdist instead (specifically
52 # netifaces). 52 # netifaces).
53 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\')\\""', 53 onlyif => '/bin/bash -c "test \\"$(pip list --format columns | sed -ne \'s/^subunit2sql\s\+\([[:digit:].]*\)\s*$/\1/p\')\\" != \\"$(pip search \'subunit2sql$\' | sed -ne \'s/^subunit2sql (\(.*\)).*$/\1/p\')\\""',
54 require => [ 54 require => [
55 Class['pip'], 55 Class['pip'],
56 Package['python-mysqldb'], 56 Package['python-mysqldb'],