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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9707377bd0ca4839a54a9be2065b9d134d0425db2eeca3ae8837d632a5f6a0c3
|
4
|
+
data.tar.gz: cb0adbf00001fab2415c0e6d74404fcc6177182486cb7b3f00314bb8e8078c12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
-
|
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
|
|
data/lib/chef/version.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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.
|
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-
|
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.
|
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.
|
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.
|
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.
|
40
|
+
version: 16.9.20
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: train-core
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|