kitchen-salt 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c37b796e056dcc14db8725ccd88b8e0e2cc9f121f114360a9a19efda8446bdc5
|
4
|
+
data.tar.gz: f1a3d9bb0207b05471a22244337ecf2a2734c022b6880dd60b2e9d7a860c19cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e3a6116b1608d75e2136c4a2502527494b854c3ad790db928d6118130e9d1422cf6b471608ef8a37685698cc194088772984d69401899670e5f95a11c434f56
|
7
|
+
data.tar.gz: 66f41fc7628ae53f0ed402a71d6f18cf4e0ee779e3cf1d27c38c69593a9f58d94a6eee954b351a868f12d0ff2fe6d2f360d29a706dfb794cdd6c858c7dc7c71f
|
data/lib/kitchen-salt/version.rb
CHANGED
@@ -39,6 +39,8 @@ then
|
|
39
39
|
#{sudo('sh')} $BOOTSTRAP #{bootstrap_options}
|
40
40
|
elif [ -z "${SALT_VERSION}" -a "#{salt_install}" = "pip" ]
|
41
41
|
then
|
42
|
+
echo "Makesure setuptools is new enough"
|
43
|
+
#{sudo(salt_pip_bin)} install "setuptools>=30"
|
42
44
|
echo #{sudo(salt_pip_bin)} #{salt_pip_install_command} #{salt_pip_pkg}
|
43
45
|
#{sudo(salt_pip_bin)} #{salt_pip_install_command} #{salt_pip_pkg}
|
44
46
|
elif [ -z "${SALT_VERSION}" -a "#{salt_install}" = "apt" ]
|
@@ -37,6 +37,7 @@ module Kitchen
|
|
37
37
|
|
38
38
|
DEFAULT_CONFIG = {
|
39
39
|
bootstrap_url: 'https://raw.githubusercontent.com/saltstack/kitchen-salt/master/assets/install.sh',
|
40
|
+
cache_commands: [],
|
40
41
|
chef_bootstrap_url: 'https://www.chef.io/chef/install.sh',
|
41
42
|
dependencies: [],
|
42
43
|
dry_run: false,
|
@@ -197,6 +198,7 @@ module Kitchen
|
|
197
198
|
prepare_grains
|
198
199
|
prepare_states
|
199
200
|
prepare_state_top
|
201
|
+
prepare_cache_commands
|
200
202
|
# upload scripts, cached formulas, and setup system repositories
|
201
203
|
prepare_dependencies
|
202
204
|
end
|
@@ -268,7 +270,7 @@ module Kitchen
|
|
268
270
|
cmd << " --id=#{config[:salt_minion_id]}" if config[:salt_minion_id]
|
269
271
|
cmd << " test=#{config[:dry_run]}" if config[:dry_run]
|
270
272
|
cmd << ' --force-color' if config[:salt_force_color]
|
271
|
-
if salt_version > RETCODE_VERSION || salt_version == 'latest'
|
273
|
+
if "#{salt_version}" > RETCODE_VERSION || salt_version == 'latest'
|
272
274
|
# hope for the best and hope it works eventually
|
273
275
|
cmd << ' --retcode-passthrough'
|
274
276
|
end
|
@@ -285,7 +287,7 @@ module Kitchen
|
|
285
287
|
# https://github.com/saltstack/salt/pull/11337
|
286
288
|
# Unless we know we have a version that supports --retcode-passthrough
|
287
289
|
# attempt to scan the output for signs of failure
|
288
|
-
if config[:salt_version] <= RETCODE_VERSION
|
290
|
+
if "#{config[:salt_version]}" <= RETCODE_VERSION
|
289
291
|
# scan the output for signs of failure, there is a risk of false negatives
|
290
292
|
fail_grep = 'grep -e Result.*False -e Data.failed.to.compile -e No.matching.sls.found.for'
|
291
293
|
# capture any non-zero exit codes from the salt-call | tee pipe
|
@@ -416,6 +418,24 @@ module Kitchen
|
|
416
418
|
dependencies_content = ERB.new(File.read(dependencies_script)).result(binding)
|
417
419
|
write_raw_file(File.join(sandbox_path, 'dependencies.sh'), dependencies_content)
|
418
420
|
end
|
421
|
+
|
422
|
+
def prepare_cache_commands
|
423
|
+
ctx = to_hash
|
424
|
+
config[:cache_commands].each do |cmd|
|
425
|
+
system(cmd % ctx)
|
426
|
+
if $?.exitstatus.nonzero?
|
427
|
+
raise ActionFailed,
|
428
|
+
"cache_command '#{cmd}' failed to execute (exit status #{$?.exitstatus})"
|
429
|
+
end
|
430
|
+
end
|
431
|
+
end
|
432
|
+
|
433
|
+
def to_hash
|
434
|
+
hash = Hash.new
|
435
|
+
instance_variables.each {|var| hash[var[1..-1]] = instance_variable_get(var) }
|
436
|
+
hash.map{|k,v| [k.to_s.to_sym,v]}.to_h
|
437
|
+
end
|
438
|
+
|
419
439
|
end
|
420
440
|
end
|
421
441
|
end
|
@@ -32,7 +32,7 @@ module Kitchen
|
|
32
32
|
File.join(root_path, config[:testingdir], '/tests/runtests.py'),
|
33
33
|
'--sysinfo',
|
34
34
|
'--output-columns=80',
|
35
|
-
(config[:windows] ? "--names-file=#{root_path}\\testing\\tests\\whitelist.txt" : ''),
|
35
|
+
(config[:windows] && config[:tests].empty? ? "--names-file=#{root_path}\\testing\\tests\\whitelist.txt" : ''),
|
36
36
|
(config[:transport] ? "--transport=#{config[:transport]}" : ''),
|
37
37
|
(config[:verbose] ? '-vv' : '-v'),
|
38
38
|
(config[:run_destructive] ? "--run-destructive" : ''),
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-salt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SaltStack Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|