Skip to content

Commit

Permalink
Fix a few chefstyle issues (#1921)
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Smith <tsmith84@gmail.com>

Signed-off-by: Tim Smith <tsmith84@gmail.com>
  • Loading branch information
tas50 committed Nov 3, 2022
1 parent 75bdd71 commit 8eb547c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Expand Up @@ -2,8 +2,9 @@

## [3.4.0](https://github.com/test-kitchen/test-kitchen/tree/v3.4.0) (2022-10-20)

- Support modern SSH keys on test instances with newer net-ssh/net-scp ([@tas50](https://github.com/tas50))
- Require Ruby 2.7 or later since 2.6 is now EOL ([@tas50](https://github.com/tas50))
- Support modern SSH keys on test instances with newer net-ssh/net-scp ([@tas50](https://github.com/tas50))
- Require Ruby 2.7 or later since 2.6 is now EOL ([@tas50](https://github.com/tas50))

## [3.3.2](https://github.com/test-kitchen/test-kitchen/tree/v3.3.2) (2022-08-03)

[Full Changelog](https://github.com/test-kitchen/test-kitchen/compare/v3.3.1...v3.3.2)
Expand Down
12 changes: 5 additions & 7 deletions lib/kitchen/lifecycle_hooks.rb
Expand Up @@ -43,13 +43,11 @@ def initialize(config, state_file)
# @param block [Proc] Block of code implementing the lifecycle phase.
# @return [void]
def run_with_hooks(phase, state_file, &block)
begin
run(phase, :pre)
yield
run(phase, :post)
ensure
run(phase, :finally)
end
run(phase, :pre)
yield
run(phase, :post)
ensure
run(phase, :finally)
end

# @return [Kitchen::StateFile]
Expand Down
2 changes: 1 addition & 1 deletion lib/kitchen/verifier/base.rb
Expand Up @@ -73,7 +73,7 @@ def call(state)
conn.upload(sandbox_dirs, config[:root_path])
debug("Transfer complete")
conn.execute(prepare_command)

begin
conn.execute(run_command)
ensure
Expand Down
2 changes: 1 addition & 1 deletion spec/kitchen/lifecycle_hooks_spec.rb
Expand Up @@ -111,7 +111,7 @@ def expect_remote_hook_generated_and_run(phase, hook)
it "runs finally even if stage fails" do
local_command = "echo foo"
config.update(finally_create: [local_command])
hook = expect_local_hook_generated_and_run(:finally, { local: local_command })
hook = expect_local_hook_generated_and_run(:finally, { local: local_command }) # rubocop: disable Lint/UselessAssignment
begin
lifecycle_hooks.run_with_hooks(:create, state_file) {
raise Error
Expand Down

0 comments on commit 8eb547c

Please sign in to comment.