compat_resource 12.8.0 → 12.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/files/lib/chef_compat/copied_from_chef/chef/dsl/declare_resource.rb +1 -3
- data/files/lib/chef_compat/copied_from_chef/chef/mixin/params_validate.rb +2 -2
- data/files/lib/chef_compat/copied_from_chef/chef/mixin/properties.rb +1 -1
- data/files/lib/chef_compat/copied_from_chef/chef/property.rb +5 -4
- data/files/lib/chef_compat/monkeypatches.rb +2 -0
- data/files/lib/chef_compat/monkeypatches/chef/mixin/params_validate.rb +17 -0
- data/files/lib/chef_compat/monkeypatches/chef/property.rb +15 -0
- data/files/lib/compat_resource/version.rb +1 -1
- data/files/spec/data/Gemfile +2 -0
- data/files/spec/data/Gemfile.lock +26 -28
- data/files/spec/data/config.rb +1 -0
- metadata +17 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c45688963a295258e1f01af0d8aa7330b874cca
|
4
|
+
data.tar.gz: 77dc4540fab1ca49ea48fd5b682e05e7ab94bcfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e8f74255fd8a62cd100dff05f85977a2b83594683b00128247967896e4533948fa6cdff8c05548347678bd3b0083ffb2c52151e5a1734698a5818ef7818fb30
|
7
|
+
data.tar.gz: 4a5cbcb9bad8c0edc20896791e7c0cced8ebaae9a1d39e8fcd10b5238537fddb2a503ef92bc7b67670b8bad974a21d66689a650bf65b6aa20599ac853df7618c
|
@@ -97,9 +97,7 @@ class Chef < (defined?(::Chef) ? ::Chef : Object)
|
|
97
97
|
#
|
98
98
|
def build_resource(type, name, created_at = nil, run_context: self.run_context, &resource_attrs_block)
|
99
99
|
created_at ||= caller[0]
|
100
|
-
|
101
|
-
require "chef_compat/copied_from_chef/chef/resource_builder" unless defined?(Chef::ResourceBuilder)
|
102
|
-
end
|
100
|
+
require "chef_compat/copied_from_chef/chef/resource_builder" unless defined?(Chef::ResourceBuilder)
|
103
101
|
|
104
102
|
Chef::ResourceBuilder.new(
|
105
103
|
type: type,
|
@@ -476,7 +476,7 @@ class Chef < (defined?(::Chef) ? ::Chef : Object)
|
|
476
476
|
# "value nil" and to keep default stickiness working exactly the same
|
477
477
|
# @api private
|
478
478
|
class SetOrReturnProperty < (defined?(::Chef::Mixin::ParamsValidate::SetOrReturnProperty) ? ::Chef::Mixin::ParamsValidate::SetOrReturnProperty : Chef::Property)
|
479
|
-
def get(resource)
|
479
|
+
def get(resource, nil_set: false)
|
480
480
|
value = super
|
481
481
|
# All values are sticky, frozen or not
|
482
482
|
if !is_set?(resource)
|
@@ -488,7 +488,7 @@ class Chef < (defined?(::Chef) ? ::Chef : Object)
|
|
488
488
|
def call(resource, value = NOT_PASSED)
|
489
489
|
# setting to nil does a get
|
490
490
|
if value.nil? && !explicitly_accepts_nil?(resource)
|
491
|
-
get(resource)
|
491
|
+
get(resource, nil_set: true)
|
492
492
|
else
|
493
493
|
super
|
494
494
|
end
|
@@ -106,7 +106,7 @@ class Chef < (defined?(::Chef) ? ::Chef : Object)
|
|
106
106
|
def property(name, type = NOT_PASSED, **options)
|
107
107
|
name = name.to_sym
|
108
108
|
|
109
|
-
options.
|
109
|
+
options = options.inject({}) { |memo, (key, value)| memo[key.to_sym] = value; memo }
|
110
110
|
|
111
111
|
options[:instance_variable_name] = :"@#{name}" if !options.has_key?(:instance_variable_name)
|
112
112
|
options[:name] = name
|
@@ -93,7 +93,7 @@ class Chef < (defined?(::Chef) ? ::Chef : Object)
|
|
93
93
|
#
|
94
94
|
def initialize(**options)
|
95
95
|
super if defined?(::Chef::Property)
|
96
|
-
options.
|
96
|
+
options = options.inject({}) { |memo, (key, value)| memo[key.to_sym] = value; memo }
|
97
97
|
@options = options
|
98
98
|
options[:name] = options[:name].to_sym if options[:name]
|
99
99
|
options[:instance_variable_name] = options[:instance_variable_name].to_sym if options[:instance_variable_name]
|
@@ -272,7 +272,7 @@ super if defined?(::Chef::Property)
|
|
272
272
|
# In Chef 12, value(nil) does a *get* instead of a set, so we
|
273
273
|
# warn if the value would have been changed. In Chef 13, it will be
|
274
274
|
# equivalent to value = nil.
|
275
|
-
result = get(resource)
|
275
|
+
result = get(resource, nil_set: true)
|
276
276
|
|
277
277
|
# Warn about this becoming a set in Chef 13.
|
278
278
|
begin
|
@@ -317,7 +317,7 @@ super if defined?(::Chef::Property)
|
|
317
317
|
# @raise Chef::Exceptions::ValidationFailed If the value is invalid for
|
318
318
|
# this property, or if the value is required and not set.
|
319
319
|
#
|
320
|
-
def get(resource)
|
320
|
+
def get(resource, nil_set: false)
|
321
321
|
# If it's set, return it (and evaluate any lazy values)
|
322
322
|
if is_set?(resource)
|
323
323
|
value = get_value(resource)
|
@@ -341,7 +341,8 @@ super if defined?(::Chef::Property)
|
|
341
341
|
#
|
342
342
|
# It won't do what they expect. This checks whether you try to *read*
|
343
343
|
# `content` while we are compiling the resource.
|
344
|
-
if
|
344
|
+
if !nil_set &&
|
345
|
+
resource.respond_to?(:resource_initializing) &&
|
345
346
|
resource.resource_initializing &&
|
346
347
|
resource.respond_to?(:enclosing_provider) &&
|
347
348
|
resource.enclosing_provider &&
|
@@ -1,7 +1,9 @@
|
|
1
1
|
require 'chef_compat/monkeypatches/chef'
|
2
2
|
require 'chef_compat/monkeypatches/chef/log'
|
3
|
+
require 'chef_compat/monkeypatches/chef/mixin/params_validate'
|
3
4
|
require 'chef_compat/monkeypatches/chef/recipe'
|
4
5
|
require 'chef_compat/monkeypatches/chef/resource'
|
6
|
+
require 'chef_compat/monkeypatches/chef/property'
|
5
7
|
require 'chef_compat/monkeypatches/chef/provider'
|
6
8
|
require 'chef_compat/monkeypatches/chef/resource/lwrp_base'
|
7
9
|
require 'chef_compat/monkeypatches/chef/exceptions'
|
@@ -0,0 +1,17 @@
|
|
1
|
+
if Chef::VERSION.to_f >= 12.5 && Chef::VERSION.to_f <= 12.8
|
2
|
+
require 'chef/mixin/params_validate'
|
3
|
+
class Chef
|
4
|
+
module Mixin
|
5
|
+
module ParamsValidate
|
6
|
+
class SetOrReturnProperty < Chef::Property
|
7
|
+
# 12.9 introduced a new optional parameter to `get()` to avoid a nil-set warning.
|
8
|
+
# When their method gets called with 2 args, we need to ignore and call with 1.
|
9
|
+
alias_method :_original_get2, :get
|
10
|
+
def get(resource, *args)
|
11
|
+
_original_get2(resource)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# 12.9 introduced a new optional parameter to `get()` to avoid a nil-set warning.
|
2
|
+
# We need to mimick it here.
|
3
|
+
if Chef::VERSION.to_f >= 12.5 && Chef::VERSION.to_f <= 12.8
|
4
|
+
require 'chef/property'
|
5
|
+
class Chef
|
6
|
+
class Property
|
7
|
+
# 12.9 introduced a new optional parameter to `get()` to avoid a nil-set warning.
|
8
|
+
# When their method gets called with 2 args, we need to ignore and call with 1.
|
9
|
+
alias_method :_original_get, :get
|
10
|
+
def get(resource, *args)
|
11
|
+
_original_get(resource)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/files/spec/data/Gemfile
CHANGED
@@ -1,23 +1,23 @@
|
|
1
|
-
|
1
|
+
PATH
|
2
|
+
remote: /Users/jkeiser/src/chef
|
2
3
|
specs:
|
3
|
-
|
4
|
-
|
5
|
-
chef-config (= 12.
|
6
|
-
chef-zero (~> 4.
|
4
|
+
chef (12.9.0)
|
5
|
+
bundler (>= 1.10)
|
6
|
+
chef-config (= 12.9.0)
|
7
|
+
chef-zero (~> 4.5)
|
7
8
|
diff-lcs (~> 1.2, >= 1.2.4)
|
8
9
|
erubis (~> 2.7)
|
9
10
|
ffi-yajl (~> 2.2)
|
10
11
|
highline (~> 1.6, >= 1.6.9)
|
11
|
-
mixlib-authentication (~> 1.
|
12
|
+
mixlib-authentication (~> 1.4)
|
12
13
|
mixlib-cli (~> 1.4)
|
13
14
|
mixlib-log (~> 1.3)
|
14
15
|
mixlib-shellout (~> 2.0)
|
15
|
-
net-ssh (
|
16
|
+
net-ssh (>= 2.9, < 4.0)
|
16
17
|
net-ssh-multi (~> 1.1)
|
17
18
|
ohai (>= 8.6.0.alpha.1, < 9)
|
18
19
|
plist (~> 3.1.0)
|
19
20
|
proxifier (~> 1.0)
|
20
|
-
pry (~> 0.9)
|
21
21
|
rspec-core (~> 3.4)
|
22
22
|
rspec-expectations (~> 3.4)
|
23
23
|
rspec-mocks (~> 3.4)
|
@@ -25,16 +25,21 @@ GEM
|
|
25
25
|
serverspec (~> 2.7)
|
26
26
|
specinfra (~> 2.10)
|
27
27
|
syslog-logger (~> 1.6)
|
28
|
-
|
28
|
+
uuidtools (~> 2.1.5)
|
29
|
+
chef-config (12.9.0)
|
29
30
|
mixlib-config (~> 2.0)
|
30
31
|
mixlib-shellout (~> 2.0)
|
31
|
-
|
32
|
+
|
33
|
+
GEM
|
34
|
+
remote: https://rubygems.org/
|
35
|
+
specs:
|
36
|
+
builder (3.2.2)
|
37
|
+
chef-zero (4.5.0)
|
32
38
|
ffi-yajl (~> 2.2)
|
33
39
|
hashie (>= 2.0, < 4.0)
|
34
40
|
mixlib-log (~> 1.3)
|
35
41
|
rack
|
36
42
|
uuidtools (~> 2.1)
|
37
|
-
coderay (1.1.0)
|
38
43
|
diff-lcs (1.2.5)
|
39
44
|
erubis (2.7.0)
|
40
45
|
ffi (1.9.10)
|
@@ -42,9 +47,8 @@ GEM
|
|
42
47
|
libyajl2 (~> 1.2)
|
43
48
|
hashie (3.4.3)
|
44
49
|
highline (1.7.8)
|
45
|
-
ipaddress (0.8.
|
50
|
+
ipaddress (0.8.3)
|
46
51
|
libyajl2 (1.2.0)
|
47
|
-
method_source (0.8.2)
|
48
52
|
mixlib-authentication (1.4.0)
|
49
53
|
mixlib-log
|
50
54
|
rspec-core (~> 3.2)
|
@@ -53,18 +57,18 @@ GEM
|
|
53
57
|
mixlib-cli (1.5.0)
|
54
58
|
mixlib-config (2.2.1)
|
55
59
|
mixlib-log (1.6.0)
|
56
|
-
mixlib-shellout (2.2.
|
60
|
+
mixlib-shellout (2.2.6)
|
57
61
|
multi_json (1.11.2)
|
58
62
|
net-scp (1.2.1)
|
59
63
|
net-ssh (>= 2.6.5)
|
60
|
-
net-ssh (
|
64
|
+
net-ssh (3.0.2)
|
61
65
|
net-ssh-gateway (1.2.0)
|
62
66
|
net-ssh (>= 2.6.5)
|
63
67
|
net-ssh-multi (1.2.1)
|
64
68
|
net-ssh (>= 2.6.5)
|
65
69
|
net-ssh-gateway (>= 1.2.0)
|
66
70
|
net-telnet (0.1.1)
|
67
|
-
ohai (8.
|
71
|
+
ohai (8.12.1)
|
68
72
|
chef-config (>= 12.5.0.alpha.1, < 13)
|
69
73
|
ffi (~> 1.9)
|
70
74
|
ffi-yajl (~> 2.2)
|
@@ -73,22 +77,17 @@ GEM
|
|
73
77
|
mixlib-config (~> 2.0)
|
74
78
|
mixlib-log
|
75
79
|
mixlib-shellout (~> 2.0)
|
76
|
-
|
80
|
+
plist
|
77
81
|
systemu (~> 2.6.4)
|
78
82
|
wmi-lite (~> 1.0)
|
79
83
|
plist (3.1.0)
|
80
84
|
proxifier (1.0.3)
|
81
|
-
pry (0.10.3)
|
82
|
-
coderay (~> 1.1.0)
|
83
|
-
method_source (~> 0.8.1)
|
84
|
-
slop (~> 3.4)
|
85
85
|
rack (1.6.4)
|
86
|
-
rake (10.5.0)
|
87
86
|
rspec (3.4.0)
|
88
87
|
rspec-core (~> 3.4.0)
|
89
88
|
rspec-expectations (~> 3.4.0)
|
90
89
|
rspec-mocks (~> 3.4.0)
|
91
|
-
rspec-core (3.4.
|
90
|
+
rspec-core (3.4.4)
|
92
91
|
rspec-support (~> 3.4.0)
|
93
92
|
rspec-expectations (3.4.0)
|
94
93
|
diff-lcs (>= 1.2.0, < 2.0)
|
@@ -103,14 +102,13 @@ GEM
|
|
103
102
|
rspec_junit_formatter (0.2.3)
|
104
103
|
builder (< 4)
|
105
104
|
rspec-core (>= 2, < 4, != 2.12.0)
|
106
|
-
serverspec (2.
|
105
|
+
serverspec (2.31.0)
|
107
106
|
multi_json
|
108
107
|
rspec (~> 3.0)
|
109
108
|
rspec-its
|
110
|
-
specinfra (~> 2.
|
109
|
+
specinfra (~> 2.53)
|
111
110
|
sfl (2.2)
|
112
|
-
|
113
|
-
specinfra (2.50.3)
|
111
|
+
specinfra (2.53.1)
|
114
112
|
net-scp
|
115
113
|
net-ssh (>= 2.7, < 3.1)
|
116
114
|
net-telnet
|
@@ -124,7 +122,7 @@ PLATFORMS
|
|
124
122
|
ruby
|
125
123
|
|
126
124
|
DEPENDENCIES
|
127
|
-
chef
|
125
|
+
chef!
|
128
126
|
|
129
127
|
BUNDLED WITH
|
130
128
|
1.11.2
|
data/files/spec/data/config.rb
CHANGED
metadata
CHANGED
@@ -1,83 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compat_resource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 12.
|
4
|
+
version: 12.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Keiser
|
8
8
|
autorequire:
|
9
9
|
bindir: files/bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: cheffish
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: stove
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: chef
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
description: Bring some new features of Chef 12.5 to previous 12.X releases
|
@@ -108,6 +108,8 @@ files:
|
|
108
108
|
- files/lib/chef_compat/monkeypatches/chef.rb
|
109
109
|
- files/lib/chef_compat/monkeypatches/chef/exceptions.rb
|
110
110
|
- files/lib/chef_compat/monkeypatches/chef/log.rb
|
111
|
+
- files/lib/chef_compat/monkeypatches/chef/mixin/params_validate.rb
|
112
|
+
- files/lib/chef_compat/monkeypatches/chef/property.rb
|
111
113
|
- files/lib/chef_compat/monkeypatches/chef/provider.rb
|
112
114
|
- files/lib/chef_compat/monkeypatches/chef/recipe.rb
|
113
115
|
- files/lib/chef_compat/monkeypatches/chef/resource.rb
|
@@ -154,17 +156,17 @@ require_paths:
|
|
154
156
|
- files/lib
|
155
157
|
required_ruby_version: !ruby/object:Gem::Requirement
|
156
158
|
requirements:
|
157
|
-
- -
|
159
|
+
- - '>='
|
158
160
|
- !ruby/object:Gem::Version
|
159
161
|
version: '0'
|
160
162
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
161
163
|
requirements:
|
162
|
-
- -
|
164
|
+
- - '>='
|
163
165
|
- !ruby/object:Gem::Version
|
164
166
|
version: '0'
|
165
167
|
requirements: []
|
166
168
|
rubyforge_project:
|
167
|
-
rubygems_version: 2.
|
169
|
+
rubygems_version: 2.5.1
|
168
170
|
signing_key:
|
169
171
|
specification_version: 4
|
170
172
|
summary: Bring some new features of Chef 12.5 to previous 12.X releases
|