chef-provisioning-aws 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd5c21364731d0404bcc87495c3a1e7fddc9b107
|
4
|
+
data.tar.gz: b0f57238cd577c5be3b7ee652079d1185a3fef8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9676f4c941de6c694f9df2d58d04b0fd03a5958a23c10cacae91a50c4bfe52d1aadf249e36346ab2c003f4931d127d599a744ba9740505ee2d3c457f08ba6d79
|
7
|
+
data.tar.gz: c84c5149b0127cfabed5ad71f967a48cc0dce1cf05ebc80b8b90e3433b1ac485f5ff2a42459d4167aa1e954112617cf8cf8d4f295c6623b547ef97f8c60c85f3
|
@@ -1,45 +1,64 @@
|
|
1
1
|
require 'chef/resource/lwrp_base'
|
2
2
|
|
3
3
|
class Chef
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
4
|
+
module Provisioning
|
5
|
+
module AWSDriver
|
6
|
+
class SuperLWRP < Chef::Resource::LWRPBase
|
7
|
+
#
|
8
|
+
# Add the :lazy_default and :coerce validation_opts to `attribute`
|
9
|
+
#
|
10
|
+
def self.attribute(attr_name, validation_opts={})
|
11
|
+
lazy_default = validation_opts.delete(:lazy_default)
|
12
|
+
coerce = validation_opts.delete(:coerce)
|
13
|
+
if lazy_default || coerce
|
14
|
+
define_method(attr_name) do |arg=nil|
|
15
|
+
arg = instance_exec(arg, &coerce) if coerce && !arg.nil?
|
16
16
|
|
17
|
-
|
17
|
+
result = set_or_return(attr_name.to_sym, arg, validation_opts)
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
if result.nil? && arg.nil?
|
20
|
+
result = instance_eval(&lazy_default) if lazy_default
|
21
|
+
end
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
else
|
29
|
-
set_or_return(attr_name.to_sym, arg, validation_opts)
|
30
|
-
end
|
31
|
-
end
|
23
|
+
result
|
24
|
+
end
|
25
|
+
define_method(:"#{attr_name}=") do |arg|
|
26
|
+
if arg.nil?
|
27
|
+
remove_instance_variable(:"@#{arg}")
|
32
28
|
else
|
33
|
-
|
29
|
+
set_or_return(attr_name.to_sym, arg, validation_opts)
|
34
30
|
end
|
35
31
|
end
|
32
|
+
else
|
33
|
+
super
|
34
|
+
end
|
35
|
+
end
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
# FUUUUUU cloning - this works for Chef 11 or 12.1
|
38
|
+
def load_prior_resource(*args)
|
39
|
+
Chef::Log.debug "Overloading #{self.resource_name} load_prior_resource with NOOP"
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
41
45
|
|
42
|
-
|
46
|
+
module NoResourceCloning
|
47
|
+
def prior_resource
|
48
|
+
if resource_class.kind_of?(Chef::Provisioning::AWSDriver::SuperLWRP)
|
49
|
+
Chef::Log.debug "Canceling resource cloning for #{resource_class}"
|
50
|
+
nil
|
51
|
+
else
|
52
|
+
super
|
43
53
|
end
|
44
54
|
end
|
55
|
+
def emit_cloned_resource_warning; end
|
56
|
+
def emit_harmless_cloning_debug; end
|
57
|
+
end
|
58
|
+
|
59
|
+
# Chef 12.2 changed `load_prior_resource` logic to be in the Chef::ResourceBuilder class
|
60
|
+
# but that class only exists in 12.2 and up
|
61
|
+
if defined? Chef::ResourceBuilder
|
62
|
+
# Ruby 2.0.0 has prepend as a protected method
|
63
|
+
Chef::ResourceBuilder.send(:prepend, NoResourceCloning)
|
45
64
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-provisioning-aws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Ewart
|
@@ -73,7 +73,7 @@ dependencies:
|
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '4.2'
|
76
|
-
type: :
|
76
|
+
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|