beaker_puppet_helpers 3.2.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/beaker_puppet_helpers.gemspec +1 -1
- data/lib/beaker_puppet_helpers/dsl.rb +6 -7
- data/spec/beaker_puppet_helpers/dsl_spec.rb +19 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d75c6f419e157614121b5a9de767c2de8c3e2140dab6abf0930c681e9beadf4c
|
|
4
|
+
data.tar.gz: c4c8e080500c1857e20639e498f256f6219b7b654d35012fb8152dd5af1d7cb7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f76bd5da6ebf7799d713b6ce1f608445ad5bb4d048b67a327af81cfb7b6e5babcf1669372801804a6500c112467496e9d788d5e4c9cb9ed1ebb434979e16ca5e
|
|
7
|
+
data.tar.gz: 0d36eb4df0b6f9cadec39e5eabe04ac93ae574e4371ca9b8f486e60b5eab61b79e13906524262cd27036c0390db4fbfa75332b52a6bfb770b4383aa410d48448
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [3.2.1](https://github.com/voxpupuli/beaker_puppet_helpers/tree/3.2.1) (2026-01-21)
|
|
6
|
+
|
|
7
|
+
[Full Changelog](https://github.com/voxpupuli/beaker_puppet_helpers/compare/3.2.0...3.2.1)
|
|
8
|
+
|
|
9
|
+
**Closed issues:**
|
|
10
|
+
|
|
11
|
+
- apply\_manifest\_on no longer returns the output of the command [\#99](https://github.com/voxpupuli/beaker_puppet_helpers/issues/99)
|
|
12
|
+
|
|
13
|
+
**Merged pull requests:**
|
|
14
|
+
|
|
15
|
+
- Restore behavior of apply\_manifest\_on [\#100](https://github.com/voxpupuli/beaker_puppet_helpers/pull/100) ([jaevans](https://github.com/jaevans))
|
|
16
|
+
|
|
5
17
|
## [3.2.0](https://github.com/voxpupuli/beaker_puppet_helpers/tree/3.2.0) (2026-01-06)
|
|
6
18
|
|
|
7
19
|
[Full Changelog](https://github.com/voxpupuli/beaker_puppet_helpers/compare/3.1.1...3.2.0)
|
|
@@ -175,13 +175,12 @@ module BeakerPuppetHelpers
|
|
|
175
175
|
|
|
176
176
|
file_path = host.tmpfile(%(apply_manifest_#{Time.now.strftime('%H%M%S%L')}), '.pp')
|
|
177
177
|
begin
|
|
178
|
+
cleanup = false
|
|
178
179
|
create_remote_file(host, file_path, "#{manifest}\n")
|
|
179
180
|
|
|
180
|
-
on(host, Beaker::PuppetCommand.new('apply', file_path, puppet_apply_opts), **on_options, &block)
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
success = false
|
|
184
|
-
raise
|
|
181
|
+
result = on(host, Beaker::PuppetCommand.new('apply', file_path, puppet_apply_opts), **on_options, &block)
|
|
182
|
+
cleanup = true
|
|
183
|
+
result
|
|
185
184
|
ensure
|
|
186
185
|
# Respect BEAKER_destroy environment variable for file cleanup
|
|
187
186
|
beaker_destroy = ENV.fetch('BEAKER_destroy', 'always').downcase
|
|
@@ -189,9 +188,9 @@ module BeakerPuppetHelpers
|
|
|
189
188
|
when 'no', 'never'
|
|
190
189
|
false
|
|
191
190
|
when 'onpass'
|
|
192
|
-
|
|
191
|
+
cleanup
|
|
193
192
|
when 'onfail'
|
|
194
|
-
!
|
|
193
|
+
!cleanup
|
|
195
194
|
else
|
|
196
195
|
true
|
|
197
196
|
end
|
|
@@ -175,6 +175,25 @@ describe BeakerPuppetHelpers::DSL do
|
|
|
175
175
|
dsl.apply_manifest_on(agent, 'class { "boo": }', show_diff: true)
|
|
176
176
|
end
|
|
177
177
|
|
|
178
|
+
it 'returns the result of the on call on success' do
|
|
179
|
+
expected_result = instance_double(Beaker::Result)
|
|
180
|
+
expect(dsl).to receive(:create_remote_file).and_return(true)
|
|
181
|
+
expect(Beaker::PuppetCommand).to receive(:new).and_return('puppet_command')
|
|
182
|
+
expect(dsl).to receive(:on).with(agent, 'puppet_command', acceptable_exit_codes: [0]).and_return(expected_result)
|
|
183
|
+
|
|
184
|
+
result = dsl.apply_manifest_on(agent, 'class { "boo": }')
|
|
185
|
+
expect(result).to eq(expected_result)
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
it 'returns the result of the on call even when exceptions are raised' do
|
|
189
|
+
expect(dsl).to receive(:create_remote_file).and_return(true)
|
|
190
|
+
expect(Beaker::PuppetCommand).to receive(:new).and_return('puppet_command')
|
|
191
|
+
expect(dsl).to receive(:on).with(agent, 'puppet_command', acceptable_exit_codes: [0]).and_raise(StandardError, 'apply failed')
|
|
192
|
+
expect(agent).to receive(:rm_rf)
|
|
193
|
+
|
|
194
|
+
expect { dsl.apply_manifest_on(agent, 'class { "boo": }') }.to raise_error(StandardError, 'apply failed')
|
|
195
|
+
end
|
|
196
|
+
|
|
178
197
|
context 'with BEAKER_destroy environment variable' do
|
|
179
198
|
after do
|
|
180
199
|
ENV.delete('BEAKER_destroy')
|