Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cookstyle Bot Auto Corrections with Cookstyle 7.13.0 #456

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions files/default/handler/audit_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def get_opts(reporter, quiet, attributes)
true
end
end
opts = {
{
'report' => true,
'format' => reporter, # For compatibility with older versions of inspec. TODO: Remove this line from Q2 2019
'reporter' => [reporter],
Expand All @@ -167,7 +167,6 @@ def get_opts(reporter, quiet, attributes)
reporter_message_truncation: node['audit']['result_message_limit'],
reporter_backtrace_inclusion: node['audit']['result_include_backtrace'],
}
opts
end

# run profiles and return report
Expand Down Expand Up @@ -210,20 +209,20 @@ def call(opts, profiles)
# In case InSpec raises a runtime exception without providing a valid report,
# we make one up and add two new fields to it: `status` and `status_message`
def failed_report(err)
Chef::Log.error "InSpec has raised a runtime exception. Generating a minimal failed report."
Chef::Log.error 'InSpec has raised a runtime exception. Generating a minimal failed report.'
Chef::Log.error err
{
"platform": {
"name": "unknown",
"release": "unknown"
"name": 'unknown',
"release": 'unknown',
},
"profiles": [],
"statistics": {
"duration": 0.0000001
"duration": 0.0000001,
},
"version": "4.22.0",
"status": "failed",
"status_message": err
"version": '4.22.0',
"status": 'failed',
"status_message": err,
}
end

Expand Down
2 changes: 1 addition & 1 deletion files/default/vendor/chef-automate/fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def self.resolve(target)
URI("compliance://#{target[:compliance]}")
end

return nil if uri.nil?
return if uri.nil?

# we have detailed information available in our lockfile, no need to ask the server
if target.respond_to?(:key?) && target.key?(:url)
Expand Down
3 changes: 1 addition & 2 deletions files/default/vendor/chef-server/fetcher.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
# author: Christoph Hartmann

require 'uri'
Expand Down Expand Up @@ -28,7 +27,7 @@ def self.resolve(target)
URI("compliance://#{target[:compliance]}")
end

return nil if uri.nil?
return if uri.nil?

profile = uri.host + uri.path
profile = uri.user + '@' + profile if uri.user
Expand Down
1 change: 1 addition & 0 deletions resources/inspec_gem.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
provides :inspec_gem
unified_mode true
resource_name :inspec_gem

property :gem_name, String, name_property: true
Expand Down