chef 16.9.17 → 16.9.20

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: 72f1c56597ee51d4a0fe647fb3efd685ff095241b1c9a1d143f5455b4b3abed9
4
- data.tar.gz: 86b3e34673f5c305d2eed48202d1e88ea82740e29213df190b3b491b3be41d9b
3
+ metadata.gz: 9707377bd0ca4839a54a9be2065b9d134d0425db2eeca3ae8837d632a5f6a0c3
4
+ data.tar.gz: cb0adbf00001fab2415c0e6d74404fcc6177182486cb7b3f00314bb8e8078c12
5
5
  SHA512:
6
- metadata.gz: 75fd54b5414d38ea9bc716df264b414ce394803631f1093a304d7ea6d064b54b6bef97709cf87adf340a213dc4c2428e1c2ee70f256b13b9601ccfe5f122d08a
7
- data.tar.gz: 906dce296579613c6396f88d67932c2762285f1510332afe48bb9dcb7c4f2792e66600ed840c65190c5c4bcb497df7afe33ac0cccf363d9e6e8fbd3520fc1cd1
6
+ metadata.gz: de061bc2be417f63a03db3de0e96e7823618ba6bc5ea59c7f8391384c0cc29630abd5cea1fa8466bee2c7a35275ced0b3d1d4b88e3f6748f3b9560f161d622e8
7
+ data.tar.gz: 1a283cabcd3fb48178d97cb46fe5f8515201dec8c9250f5b43700bb0af2b5a467d9f9f0c5c986fd128c10f21f575cf08d8e61713ee37723f4488970dc4f823a0
@@ -11,12 +11,12 @@ class Chef
11
11
  class Runner < EventDispatch::Base
12
12
  extend Forwardable
13
13
 
14
- attr_accessor :run_id, :recipes
14
+ attr_accessor :run_id
15
15
  attr_reader :node
16
16
  def_delegators :node, :logger
17
17
 
18
18
  def enabled?
19
- audit_cookbook_present = recipes.include?("audit::default")
19
+ audit_cookbook_present = node["recipes"].include?("audit::default")
20
20
 
21
21
  logger.info("#{self.class}##{__method__}: #{Inspec::Dist::PRODUCT_NAME} profiles? #{inspec_profiles.any?}")
22
22
  logger.info("#{self.class}##{__method__}: audit cookbook? #{audit_cookbook_present}")
@@ -37,10 +37,6 @@ class Chef
37
37
  self.run_id = run_status.run_id
38
38
  end
39
39
 
40
- def run_list_expanded(run_list_expansion)
41
- self.recipes = run_list_expansion.recipes
42
- end
43
-
44
40
  def run_completed(_node, _run_status)
45
41
  return unless enabled?
46
42
 
@@ -42,7 +42,9 @@ class Chef
42
42
  end
43
43
 
44
44
  def current_installed_version
45
- pkg_info = shell_out!("pkg", "info", new_resource.package_name, env: nil, returns: [0, 70])
45
+ # pkgng up to version 1.15.99.7 returns 70 for pkg not found,
46
+ # later versions return 1
47
+ pkg_info = shell_out!("pkg", "info", new_resource.package_name, env: nil, returns: [0, 1, 70])
46
48
  pkg_info.stdout[/^Version +: (.+)$/, 1]
47
49
  end
48
50
 
@@ -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("16.9.17")
26
+ VERSION = Chef::VersionString.new("16.9.20")
27
27
  end
28
28
 
29
29
  #
@@ -8,41 +8,40 @@ describe Chef::Compliance::Runner do
8
8
  described_class.new.tap do |r|
9
9
  r.node = node
10
10
  r.run_id = "my_run_id"
11
- r.recipes = []
12
11
  end
13
12
  end
14
13
 
15
14
  describe "#enabled?" do
16
15
  it "is true if the node attributes have audit profiles and the audit cookbook is not present" do
17
16
  node.normal["audit"]["profiles"]["ssh"] = { 'compliance': "base/ssh" }
18
- runner.recipes = %w{ fancy_cookbook::fanciness tacobell::nachos }
17
+ node.automatic["recipes"] = %w{ fancy_cookbook::fanciness tacobell::nachos }
19
18
 
20
19
  expect(runner).to be_enabled
21
20
  end
22
21
 
23
22
  it "is false if the node attributes have audit profiles and the audit cookbook is present" do
24
23
  node.normal["audit"]["profiles"]["ssh"] = { 'compliance': "base/ssh" }
25
- runner.recipes = %w{ audit::default fancy_cookbook::fanciness tacobell::nachos }
24
+ node.automatic["recipes"] = %w{ audit::default fancy_cookbook::fanciness tacobell::nachos }
26
25
 
27
26
  expect(runner).not_to be_enabled
28
27
  end
29
28
 
30
29
  it "is false if the node attributes do not have audit profiles and the audit cookbook is not present" do
31
30
  node.normal["audit"]["profiles"] = {}
32
- runner.recipes = %w{ fancy_cookbook::fanciness tacobell::nachos }
31
+ node.automatic["recipes"] = %w{ fancy_cookbook::fanciness tacobell::nachos }
33
32
 
34
33
  expect(runner).not_to be_enabled
35
34
  end
36
35
 
37
36
  it "is false if the node attributes do not have audit profiles and the audit cookbook is present" do
38
37
  node.normal["audit"]["profiles"] = {}
39
- runner.recipes = %w{ audit::default fancy_cookbook::fanciness tacobell::nachos }
38
+ node.automatic["recipes"] = %w{ audit::default fancy_cookbook::fanciness tacobell::nachos }
40
39
 
41
40
  expect(runner).not_to be_enabled
42
41
  end
43
42
 
44
43
  it "is false if the node attributes do not have audit attributes and the audit cookbook is not present" do
45
- runner.recipes = %w{ fancy_cookbook::fanciness tacobell::nachos }
44
+ node.automatic["recipes"] = %w{ fancy_cookbook::fanciness tacobell::nachos }
46
45
  expect(runner).not_to be_enabled
47
46
  end
48
47
  end
@@ -66,7 +66,7 @@ describe Chef::Provider::Package::Freebsd::Port do
66
66
  end
67
67
 
68
68
  it "should query pkg database" do
69
- expect(@provider).to receive(:shell_out_compacted!).with("pkg", "info", "zsh", env: nil, returns: [0, 70], timeout: 900).and_return(@pkg_info)
69
+ expect(@provider).to receive(:shell_out_compacted!).with("pkg", "info", "zsh", env: nil, returns: [0, 1, 70], timeout: 900).and_return(@pkg_info)
70
70
  expect(@provider.current_installed_version).to eq("3.1.7")
71
71
  end
72
72
  end
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: 16.9.17
4
+ version: 16.9.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-08 00:00:00.000000000 Z
11
+ date: 2021-01-12 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: 16.9.17
19
+ version: 16.9.20
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: 16.9.17
26
+ version: 16.9.20
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: 16.9.17
33
+ version: 16.9.20
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: 16.9.17
40
+ version: 16.9.20
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: train-core
43
43
  requirement: !ruby/object:Gem::Requirement