chef 11.16.0 → 11.16.2
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: d77fa4692b75a7d21e00502347bbe9d5fd8cc22b
|
4
|
+
data.tar.gz: 981eb98d54b3687af7f71b350596cedf63eea39b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d50a9fbeaca0a02fa13a37e7cf2237ab3f9043401b8e7c6801ac65b36218fc5688693be3491e18f86a1a8fb23b639beeb8a181f6afa55b1abf338b795684b29
|
7
|
+
data.tar.gz: 2035c100e01ed818b5ccd248dc987b0712dbf3e73b7a442f16169aac081e8aaaf478cc21f7486e9c8cbc77f81b62165c235b1f4a3ee0b97df74d2f9e9f0f9385
|
@@ -19,7 +19,7 @@
|
|
19
19
|
class Chef
|
20
20
|
class Provider
|
21
21
|
class WhyrunSafeRubyBlock < Chef::Provider::RubyBlock
|
22
|
-
def
|
22
|
+
def action_run
|
23
23
|
@new_resource.block.call
|
24
24
|
@new_resource.updated_by_last_action(true)
|
25
25
|
@run_context.events.resource_update_applied(@new_resource, :create, "execute the whyrun_safe_ruby_block #{@new_resource.name}")
|
data/lib/chef/version.rb
CHANGED
@@ -0,0 +1,51 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Serdar Sutay (<serdar@opscode.com>)
|
3
|
+
# Copyright:: Copyright (c) 2014 Opscode, Inc.
|
4
|
+
# License:: Apache License, Version 2.0
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
require 'spec_helper'
|
20
|
+
|
21
|
+
describe Chef::Resource::WhyrunSafeRubyBlock do
|
22
|
+
let(:node) { Chef::Node.new }
|
23
|
+
|
24
|
+
let(:run_context) {
|
25
|
+
events = Chef::EventDispatch::Dispatcher.new
|
26
|
+
Chef::RunContext.new(node, {}, events)
|
27
|
+
}
|
28
|
+
|
29
|
+
before do
|
30
|
+
$evil_global_evil_laugh = :wahwah
|
31
|
+
Chef::Config[:why_run] = true
|
32
|
+
end
|
33
|
+
|
34
|
+
after do
|
35
|
+
Chef::Config[:why_run] = false
|
36
|
+
end
|
37
|
+
|
38
|
+
describe "when testing the resource" do
|
39
|
+
let(:new_resource) do
|
40
|
+
r = Chef::Resource::WhyrunSafeRubyBlock.new("reload all", run_context)
|
41
|
+
r.block { $evil_global_evil_laugh = :mwahahaha }
|
42
|
+
r
|
43
|
+
end
|
44
|
+
|
45
|
+
it "updates the evil laugh, even in why-run mode" do
|
46
|
+
new_resource.run_action(new_resource.action)
|
47
|
+
$evil_global_evil_laugh.should == :mwahahaha
|
48
|
+
new_resource.should be_updated
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -30,14 +30,14 @@ describe Chef::Provider::WhyrunSafeRubyBlock, "initialize" do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
it "should call the block and flag the resource as updated" do
|
33
|
-
@provider.run_action(:
|
33
|
+
@provider.run_action(:run)
|
34
34
|
$evil_global_evil_laugh.should == :mwahahaha
|
35
35
|
@new_resource.should be_updated
|
36
36
|
end
|
37
37
|
|
38
38
|
it "should call the block and flat the resource as updated - even in whyrun" do
|
39
39
|
Chef::Config[:why_run] = true
|
40
|
-
@provider.run_action(:
|
40
|
+
@provider.run_action(:run)
|
41
41
|
$evil_global_evil_laugh.should == :mwahahaha
|
42
42
|
@new_resource.should be_updated
|
43
43
|
Chef::Config[:why_run] = false
|
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: 11.16.
|
4
|
+
version: 11.16.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Jacob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-config
|
@@ -1442,6 +1442,7 @@ files:
|
|
1442
1442
|
- spec/functional/knife/smoke_test.rb
|
1443
1443
|
- spec/functional/knife/ssh_spec.rb
|
1444
1444
|
- spec/functional/provider/remote_file/cache_control_data_spec.rb
|
1445
|
+
- spec/functional/provider/whyrun_safe_ruby_block_spec.rb
|
1445
1446
|
- spec/functional/resource/base.rb
|
1446
1447
|
- spec/functional/resource/batch_spec.rb
|
1447
1448
|
- spec/functional/resource/bff_spec.rb
|