puppet_litmus 0.22.0 → 0.23.0

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: '09a793d09382a0f461b0390ebb71f94ae4a14df41873d44a77f2006ee15934bf'
4
- data.tar.gz: eced3b1aceb10d8fc85f90dd15ab3cfc300f793b85e2f516548510d59bd9ab4c
3
+ metadata.gz: 7c3c6a488e0f0aa8b61b2f1d6678fd54d093aa11693b8ab004f57205f72049c9
4
+ data.tar.gz: 65ce0b461f8c1b0683f9b608aa08ede12d44794d766d007da423472fbb856535
5
5
  SHA512:
6
- metadata.gz: b2226c90e2928e78e44ab3faf2ff837da356934ea89768637b7943c32d615b3c04ff605a00063dff6ad24126ac5e9a43f2e86f16c6385132bbc9c4ba7a27b82e
7
- data.tar.gz: 5651ff30427d4f96b72440c28458251e00c4c595df98a602130fa95aec6f18c1f5d378d2a737ece3c918367cd38933f7aa615733ffc0c5ee77e6240f4fd82db8
6
+ metadata.gz: 2191d39436024913ac79e2e4e1ea16306f4c4ece91c6ff3782a0d67eeda849ccc1079ac8976ed1c7e1edb5d9cb5fd92b86ef1a2f9261cde1134710267e08f29c
7
+ data.tar.gz: 0661730c8fd0a5e4152840ff84edf917bd76d46691d580981d1d265d957457358aa4afa04ba6f573db9a97dfec2cb10fee74a5638249e4f31e40f7893b21e5f1
@@ -6,7 +6,6 @@
6
6
  require 'json'
7
7
 
8
8
  IMAGE_TABLE = {
9
- 'RedHat-6' => 'rhel-6',
10
9
  'RedHat-7' => 'rhel-7',
11
10
  'RedHat-8' => 'rhel-8',
12
11
  'SLES-12' => 'sles-12',
@@ -17,10 +17,7 @@ module PuppetLitmus::InventoryManipulation
17
17
  end
18
18
  raise "There is no inventory file at '#{inventory_full_path}'." unless File.exist?(inventory_full_path)
19
19
 
20
- inventory_hash = YAML.load_file(inventory_full_path)
21
- raise "Inventory file is incompatible (version 2 and up). Try the 'bolt project migrate' command." if inventory_hash['version'].nil? || (inventory_hash['version'] < 2)
22
-
23
- inventory_hash
20
+ YAML.load_file(inventory_full_path)
24
21
  end
25
22
 
26
23
  # Provide a default hash for executing against localhost
@@ -28,7 +25,6 @@ module PuppetLitmus::InventoryManipulation
28
25
  # @return [Hash] inventory.yaml hash containing only an entry for localhost
29
26
  def localhost_inventory_hash
30
27
  {
31
- 'version' => 2,
32
28
  'groups' => [
33
29
  {
34
30
  'name' => 'local',
@@ -83,18 +83,21 @@ module PuppetLitmus::PuppetHelpers
83
83
  command_to_run += ' --noop' if !opts[:noop].nil? && (opts[:noop] == true)
84
84
  command_to_run += ' --detailed-exitcodes' if use_detailed_exit_codes == true
85
85
 
86
- command_to_run = "try { #{command_to_run}; exit $LASTEXITCODE } catch { write-error $_ ; exit 1 }" if os[:family] == 'windows'
87
-
88
- span.add_field('litmus.command_to_run', command_to_run)
89
86
  span.add_field('litmus.target_node_name', target_node_name)
90
- # IAC-1365 - Workaround for BOLT-1535 and bolt issue #1650
91
- # bolt_result = run_command(command_to_run, target_node_name, config: nil, inventory: inventory_hash)
92
- bolt_result = Tempfile.open(['temp', '.ps1']) do |script|
93
- script.write(command_to_run)
94
- script.close
95
- run_script(script.path, target_node_name, [], options: {}, config: nil, inventory: inventory_hash)
96
- end
97
87
 
88
+ if os[:family] == 'windows'
89
+ # IAC-1365 - Workaround for BOLT-1535 and bolt issue #1650
90
+ command_to_run = "try { #{command_to_run}; exit $LASTEXITCODE } catch { write-error $_ ; exit 1 }"
91
+ span.add_field('litmus.command_to_run', command_to_run)
92
+ bolt_result = Tempfile.open(['temp', '.ps1']) do |script|
93
+ script.write(command_to_run)
94
+ script.close
95
+ run_script(script.path, target_node_name, [], options: {}, config: nil, inventory: inventory_hash)
96
+ end
97
+ else
98
+ span.add_field('litmus.command_to_run', command_to_run)
99
+ bolt_result = run_command(command_to_run, target_node_name, config: nil, inventory: inventory_hash)
100
+ end
98
101
  span.add_field('litmus.bolt_result', bolt_result)
99
102
  result = OpenStruct.new(exit_code: bolt_result.first['value']['exit_code'],
100
103
  stdout: bolt_result.first['value']['stdout'],
@@ -2,5 +2,5 @@
2
2
 
3
3
  # version of this gem
4
4
  module PuppetLitmus
5
- VERSION ||= '0.22.0'
5
+ VERSION ||= '0.23.0'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet_litmus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.0
4
+ version: 0.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet, Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-21 00:00:00.000000000 Z
11
+ date: 2021-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bolt
@@ -194,7 +194,7 @@ homepage: https://github.com/puppetlabs/puppet_litmus
194
194
  licenses:
195
195
  - Apache-2.0
196
196
  metadata: {}
197
- post_install_message:
197
+ post_install_message:
198
198
  rdoc_options: []
199
199
  require_paths:
200
200
  - lib
@@ -209,8 +209,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
209
  - !ruby/object:Gem::Version
210
210
  version: '0'
211
211
  requirements: []
212
- rubygems_version: 3.0.3
213
- signing_key:
212
+ rubygems_version: 3.0.6
213
+ signing_key:
214
214
  specification_version: 4
215
215
  summary: Providing a simple command line tool for puppet content creators, to enable
216
216
  simple and complex test deployments.