chef 17.9.46-universal-mingw32 → 17.9.52-universal-mingw32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cfcbcbe5a0ad79eff9aa99eb671a0fd4c707f5a92c110321523d0b538a28e2be
4
- data.tar.gz: 4789457137f4c223ce82b8eec0ebd8cae9f3ab123abd6aac701da97cc317db3a
3
+ metadata.gz: ef4f4acb5e1adc0f97c4eaf653095911e5206dfb761b740b710cbaf78358c0dc
4
+ data.tar.gz: 38ad6e54f2c3671b389ca4eafa897c3ccea722774aca326aaf65b3dbc8164e28
5
5
  SHA512:
6
- metadata.gz: 1faf50263931d7aa589efe6f764f91d7e1f593ea00216749ecaecd4f7971c60e70f84cf4fb9f2ffaa8699f56f8869c5227b7502afb6328d4fe67b673a52e2864
7
- data.tar.gz: 0deb78dd1339a331f3bf6770f21aca77617da19aeff8a77854cf0cd15c531fe16ffd505383a53f5e3212bf8b372fea3f83adedb93e1f639852c96e4aeab0fdac
6
+ metadata.gz: d48d9f5d33b520dd732ba953e0d1c3624412f34e00585085fbe6c81d4d19664a240d2d716b3362a2a310b1754a3a50c4378c83c43abe33af78c62afd045dcf90
7
+ data.tar.gz: 94d27dfbc0507da0f0cf9df56efc0f14039e33fd3c21d410667ed54f0438333fdac5655b789b9972afdcb57ae6bb14fbf5bb0e15dbd35111efce3dafe4215fb5
@@ -27,7 +27,7 @@ class Chef
27
27
 
28
28
  # Controls what is done with the resulting report after the Chef InSpec run.
29
29
  # Accepts a single string value or an array of multiple values.
30
- # Accepted values: 'chef-server-automate', 'chef-automate', 'json-file', 'audit-enforcer', 'cli'
30
+ # Accepted values: 'chef-server-automate', 'chef-automate', 'json-file', 'audit-enforcer', 'compliance-enforcer', 'cli'
31
31
  "reporter" => nil,
32
32
 
33
33
  # Controls if Chef InSpec profiles should be fetched from Chef Automate or Chef Infra Server
@@ -1,7 +1,7 @@
1
1
  class Chef
2
2
  module Compliance
3
3
  module Reporter
4
- class AuditEnforcer
4
+ class ComplianceEnforcer
5
5
  class ControlFailure < StandardError; end
6
6
 
7
7
  def send_report(report)
@@ -7,7 +7,7 @@ class Chef
7
7
  class Runner < EventDispatch::Base
8
8
  extend Forwardable
9
9
 
10
- SUPPORTED_REPORTERS = %w{chef-automate chef-server-automate json-file audit-enforcer cli}.freeze
10
+ SUPPORTED_REPORTERS = %w{chef-automate chef-server-automate json-file audit-enforcer compliance-enforcer cli}.freeze
11
11
  SUPPORTED_FETCHERS = %w{chef-automate chef-server}.freeze
12
12
 
13
13
  attr_accessor :run_id
@@ -300,7 +300,7 @@ class Chef
300
300
  require_relative "reporter/json_file"
301
301
  path = node.dig("audit", "json_file", "location")
302
302
  Chef::Compliance::Reporter::JsonFile.new(file: path)
303
- when "audit-enforcer"
303
+ when "audit-enforcer", "compliance-enforcer"
304
304
  require_relative "reporter/compliance_enforcer"
305
305
  Chef::Compliance::Reporter::ComplianceEnforcer.new
306
306
  when "cli"
data/lib/chef/resource.rb CHANGED
@@ -341,6 +341,7 @@ class Chef
341
341
  def subscribes(action, resources, timing = :delayed)
342
342
  resources = [resources].flatten
343
343
  resources.each do |resource|
344
+ validate_resource_spec!(resource)
344
345
  if resource.is_a?(String)
345
346
  resource = UnresolvedSubscribes.new(resource, run_context)
346
347
  end
data/lib/chef/version.rb CHANGED
@@ -23,7 +23,7 @@ require_relative "version_string"
23
23
 
24
24
  class Chef
25
25
  CHEF_ROOT = File.expand_path("..", __dir__)
26
- VERSION = Chef::VersionString.new("17.9.46")
26
+ VERSION = Chef::VersionString.new("17.9.52")
27
27
  end
28
28
 
29
29
  #
@@ -1,8 +1,8 @@
1
1
  require "spec_helper"
2
2
  require "chef/compliance/reporter/compliance_enforcer"
3
3
 
4
- describe Chef::Compliance::Reporter::AuditEnforcer do
5
- let(:reporter) { Chef::Compliance::Reporter::AuditEnforcer.new }
4
+ describe Chef::Compliance::Reporter::ComplianceEnforcer do
5
+ let(:reporter) { Chef::Compliance::Reporter::ComplianceEnforcer.new }
6
6
 
7
7
  it "does not raise error for a successful InSpec report" do
8
8
  report = {
@@ -44,6 +44,6 @@ describe Chef::Compliance::Reporter::AuditEnforcer do
44
44
 
45
45
  expect {
46
46
  reporter.send_report(report)
47
- }.to raise_error(Chef::Compliance::Reporter::AuditEnforcer::ControlFailure, "Audit c2 has failed. Aborting chef-client run.")
47
+ }.to raise_error(Chef::Compliance::Reporter::ComplianceEnforcer::ControlFailure, "Audit c2 has failed. Aborting chef-client run.")
48
48
  end
49
49
  end
@@ -300,27 +300,35 @@ describe Chef::Resource do
300
300
  end
301
301
 
302
302
  describe "subscribes" do
303
+ context "with syntax error in resources parameter" do
304
+ it "raises an exception immediately" do
305
+ expect do
306
+ resource.subscribes(:run, "typo[missing-closing-bracket")
307
+ end.to raise_error(Chef::Exceptions::InvalidResourceSpecification)
308
+ end
309
+ end
310
+
303
311
  it "should make resources appear in the actions hash of subscribed nodes" do
304
- run_context.resource_collection << Chef::Resource::ZenMaster.new("coffee")
312
+ run_context.resource_collection << Chef::Resource::ZenMaster.new("coffee", run_context)
305
313
  zr = run_context.resource_collection.find(zen_master: "coffee")
306
314
  resource.subscribes :reload, zr
307
315
  expect(zr.delayed_notifications.detect { |e| e.resource.name == "funk" && e.action == :reload }).not_to be_nil
308
316
  end
309
317
 
310
318
  it "should make resources appear in the actions hash of subscribed nodes" do
311
- run_context.resource_collection << Chef::Resource::ZenMaster.new("coffee")
319
+ run_context.resource_collection << Chef::Resource::ZenMaster.new("coffee", run_context)
312
320
  zr = run_context.resource_collection.find(zen_master: "coffee")
313
321
  resource.subscribes :reload, zr
314
322
  expect(zr.delayed_notifications.detect { |e| e.resource.name == resource.name && e.action == :reload }).not_to be_nil
315
323
 
316
- run_context.resource_collection << Chef::Resource::ZenMaster.new("bean")
324
+ run_context.resource_collection << Chef::Resource::ZenMaster.new("bean", run_context)
317
325
  zrb = run_context.resource_collection.find(zen_master: "bean")
318
326
  zrb.subscribes :reload, zr
319
327
  expect(zr.delayed_notifications.detect { |e| e.resource.name == resource.name && e.action == :reload }).not_to be_nil
320
328
  end
321
329
 
322
330
  it "should make subscribed resources be capable of acting immediately" do
323
- run_context.resource_collection << Chef::Resource::ZenMaster.new("coffee")
331
+ run_context.resource_collection << Chef::Resource::ZenMaster.new("coffee", run_context)
324
332
  zr = run_context.resource_collection.find(zen_master: "coffee")
325
333
  resource.subscribes :reload, zr, :immediately
326
334
  expect(zr.immediate_notifications.detect { |e| e.resource.name == resource.name && e.action == :reload }).not_to be_nil
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef
3
3
  version: !ruby/object:Gem::Version
4
- version: 17.9.46
4
+ version: 17.9.52
5
5
  platform: universal-mingw32
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-08 00:00:00.000000000 Z
11
+ date: 2022-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-config
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 17.9.46
19
+ version: 17.9.52
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 17.9.46
26
+ version: 17.9.52
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: chef-utils
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 17.9.46
33
+ version: 17.9.52
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 17.9.46
40
+ version: 17.9.52
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: train-core
43
43
  requirement: !ruby/object:Gem::Requirement