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

Various cookstyle fixes #399

Closed
wants to merge 4 commits into from
Closed
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
16 changes: 16 additions & 0 deletions .github/workflows/delivery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: delivery

on: [push, pull_request]

jobs:
delivery:

runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@master
- name: Run Chef Delivery
uses: actionshub/chef-delivery@master
env:
CHEF_LICENSE: accept-no-persist
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dist: xenial
dist: bionic

addons:
apt:
sources:
- chef-current-xenial
- chef-current-bionic
packages:
- chefdk

Expand Down
2 changes: 1 addition & 1 deletion files/default/handler/audit_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def report
# detect if we run in a chef client with chef server
load_chef_fetcher if reporters.include?('chef-server') ||
reporters.include?('chef-server-automate') ||
%w{chef-server chef-server-automate}.include?(fetcher)
%w(chef-server chef-server-automate).include?(fetcher)

load_automate_fetcher if fetcher == 'chef-automate'

Expand Down
2 changes: 1 addition & 1 deletion files/default/vendor/chef-server/fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def self.chef_server_reporter?

def self.chef_server_fetcher?
# TODO: harmonize with audit_report.rb load_chef_fetcher
%w{chef-server chef-server-compliance chef-server-visibility chef-server-automate}.include?(Chef.node.attributes['audit']['fetcher'])
%w(chef-server chef-server-compliance chef-server-visibility chef-server-automate).include?(Chef.node.attributes['audit']['fetcher'])
end

private
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/libraries/audit_enforcer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
end

it 'is not raising error for an InSpec report with no controls' do
expect(@automate.send_report({ "profiles": [{ "name": 'empty' }] })).to eq(true)
expect(@automate.send_report("profiles": [{ "name": 'empty' }])).to eq(true)
end

it 'is not raising error for an InSpec report with controls but no results' do
expect(@automate.send_report({ "profiles": [{ "controls": [{ "id": 'empty' }] }] })).to eq(true)
expect(@automate.send_report("profiles": [{ "controls": [{ "id": 'empty' }] }])).to eq(true)
end

it 'raises an error for a failed InSpec report' do
Expand Down
6 changes: 3 additions & 3 deletions spec/unit/recipes/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@
runner.converge(described_recipe)
end
it 'still contains the audit attributes after converge' do
expect(chef_run.node.attributes['audit']['attributes']).to eq({ 'my-inspec-attribute' => 'ok' })
expect(chef_run.node.attributes['audit']['attributes']).to eq('my-inspec-attribute' => 'ok')
end
it 'should contain the inspec attributes in the run_state' do
expect(chef_run.node.run_state['audit_attributes']).to eq({ 'my-inspec-attribute' => 'ok' })
expect(chef_run.node.run_state['audit_attributes']).to eq('my-inspec-attribute' => 'ok')
end
it 'should not raise an exception' do
expect { chef_run }.to_not raise_error
Expand All @@ -204,7 +204,7 @@
expect(chef_run.node.attributes['audit']['attributes']).to eq(nil)
end
it 'should contain the inspec attributes in the run_state' do
expect(chef_run.node.run_state['audit_attributes']).to eq({ 'my-inspec-attribute' => 'ok' })
expect(chef_run.node.run_state['audit_attributes']).to eq('my-inspec-attribute' => 'ok')
end
it 'should not raise an exception' do
expect { chef_run }.to_not raise_error
Expand Down