Skip to content

Commit

Permalink
Fix test errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpop committed Mar 2, 2020
1 parent bbfadb8 commit 74938cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions libraries/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ def load_audit_handler
# taking node['audit'] as parameter so that it can be called from the chef-server fetcher as well
# audit['collector'] is the legacy reporter,
def get_reporters(audit)
if audit.nil?
Chef::Log.warn("node ['audit'] is not defined")
return []
end
if audit['collector']
Chef::Log.warn("node ['audit']['collector'] is deprecated and will be removed from the next major version of the cookbook. Please use node ['audit']['reporter']")
return handle_reporters(audit['collector'])
Expand Down
6 changes: 3 additions & 3 deletions spec/unit/report/fetcher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@
},
'profile' => ['admin', 'linux-baseline', '2.0'],
}

Fetchers::Url.new('non_profile_url', config).send(:http_opts)
mynode.default['audit']['reporter'] = 'chef-server'
ChefServer::Fetcher.target_url('non_profile_url', config).read
}
expect { myproc.call }.to raise_error(RuntimeError)
expect { myproc.call }.to raise_error(Errno::ECONNREFUSED)
end
end
end

0 comments on commit 74938cb

Please sign in to comment.