Browse Source

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
changes/35/581335/2
Colleen Murphy 11 months ago
parent
commit
8360c894db
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      manifests/init.pp

+ 1
- 1
manifests/init.pp View File

@@ -50,7 +50,7 @@ class subunit2sql (
50 50
     # deps we've preinstalled from system packages because they lack wheels on
51 51
     # PyPI and must be otherwise rebuilt from sdist instead (specifically
52 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 54
     require => [
55 55
       Class['pip'],
56 56
       Package['python-mysqldb'],

Loading…
Cancel
Save