kitchen-salt 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MTJlNTRiYmI5MmNjMTc4MGFlYjkwMmFlMTQ0ZDg4NWRiZmZhZDczZg==
4
+ NDcwOTFlMGJmYmQyNjEzODU5ODU3ZDZlOGE1ZDhkMmM2NDQyNjk2NQ==
5
5
  data.tar.gz: !binary |-
6
- NDc5MGJkNjczOGMzYjFlMWRkMDhiMDk4MWRiN2UyMjJhNzk0NjY0Ng==
6
+ ZjNkYzYzMzhlMTg4Mjc1ZmJkMTk0MTU2ZThhZjNiNjU3ODA3NDNiMA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- M2E2YmFlZTg0NDZiZjUyZGQzOWMyZGM1ODJiOTRjNjNhYjQyMzdkYzNkNDI4
10
- YmMzOTM5Y2Y2ZDczZTRjNzEyM2JiMjU0NmUwNTkxYzEzM2E4YzE1YjZmZmU4
11
- Zjk4NjlhNmQ4YTQwOTlhZDgxMWRkODJiMWExNDg1Y2YyMDFiMGY=
9
+ NDk2ZTQ5ZTUzOWY5NzU2NjBmZDNiYjZjM2NiMzRhODU2Y2M1ZjIzNWNkZGI2
10
+ NWYzMGY0Yjk1NTkzMjE0NGRkMmU0MGQ1ZTM5NTQ0OWE1YzBhYjViOTgzYmM3
11
+ MzI0NTMzN2EyOGRhYjk4NDJhMzA2ZjM4MmMxYjJmMmRkZDgxNjE=
12
12
  data.tar.gz: !binary |-
13
- NTg4ZWJkYTAwN2IwYTljZTNlOGE1Yjk1ZjcwMzE3MDlkODJlYTMxMGFkOWYy
14
- NDkwYzg3Zjc5MjNkY2YwYmY0MmM5MjljNzM5NTU4NWM5ZDcwM2FiMGE1ZTA0
15
- OGUzOTk2NDQ4NmZjMjhhYTJhMmY0MWUyNGRkMmVhZTUzNTNmNDU=
13
+ ZWMyOWE1YmMwZTJmM2U4YjU5ZDMyZmFiM2Y1ZWRkOGYxYzg0MTEwZDZiNmE2
14
+ ZGY4YWYxYTI3NGU4OTVjZTcyMTI3MWQ5NmIwNDIzYmNiMThlNDI4MzRmMDIy
15
+ MGYzODQ4MjMzMTRlNjAzMDE0ZGU3YWY4ODc4MTI1OTM0MDQwYjE=
@@ -1,5 +1,5 @@
1
1
  module Kitchen
2
2
  module Salt
3
- VERSION = "0.0.13"
3
+ VERSION = "0.0.14"
4
4
  end
5
5
  end
@@ -53,7 +53,7 @@ module Kitchen
53
53
  default_config :salt_run_highstate, true
54
54
 
55
55
  # salt-call version that supports the undocumented --retcode-passthrough command
56
- RETCODE_VERSION = '2014.2.0'
56
+ RETCODE_VERSION = '0.17.5'
57
57
 
58
58
  def install_command
59
59
  debug(diagnose())
@@ -175,12 +175,20 @@ module Kitchen
175
175
  if config[:salt_version] > RETCODE_VERSION && config[:salt_version] != 'latest'
176
176
  # hope for the best and hope it works eventually
177
177
  cmd = cmd + " --retcode-passthrough"
178
- else
179
- # scan the output for signs of failure, there is a risk of false negatives
180
- fail_grep = 'grep Result.*False'
181
- cmd << " 2>&1 | tee /tmp/salt-call-output ; (sed '/#{fail_grep}/d' /tmp/salt-call-output | #{fail_grep} ; EC=$? ; [ ${EC} -eq 0 ] && exit 1 ; [ ${EC} -eq 1 ] && exit 0)"
182
178
  end
183
179
 
180
+ # scan the output for signs of failure, there is a risk of false negatives
181
+ fail_grep = 'grep -e Result.*False -e Data.failed.to.compile'
182
+ fail_grep = 'grep -e Result.*False'
183
+ # capture any non-zero exit codes from the salt-call | tee pipe
184
+ cmd = 'set -o pipefail ; ' << cmd
185
+ # Capture the salt-call output & exit code
186
+ cmd << " 2>&1 | tee /tmp/salt-call-output ; SC=$? ; echo salt-call exit code: $SC ;"
187
+ # check the salt-call output for fail messages
188
+ cmd << " (sed '/#{fail_grep}/d' /tmp/salt-call-output | #{fail_grep} ; EC=$? ; echo salt-call output grep exit code ${EC} ;"
189
+ # use the non-zer exit code from salt-call, then invert the results of the grep for failures
190
+ cmd << " [ ${SC} -ne 0 ] && exit ${SC} ; [ ${EC} -eq 0 ] && exit 1 ; [ ${EC} -eq 1 ] && exit 0)"
191
+
184
192
  cmd
185
193
  end
186
194
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-salt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon McCartney