chef 11.16.0-x86-mingw32 → 11.16.2-x86-mingw32
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 790b4f7bf0a72d93f0b8f2ec04ffcfb2bd130306
|
4
|
+
data.tar.gz: f3eae2509195aace61ca51c97d887f7830cfd01f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9a2d24e05758cc459a70ad833a44e377ed34d37a1d029d392529ef0abd4fba325beaa0ccca67c0d8477fedf6c340567a3014616560d5e5bcb3cc4bf9768347d
|
7
|
+
data.tar.gz: a005349645748b2d458725968e13c501fcbdb5cd94972182eec9ee20cbbd1c5fda5024c33a880e528cd05f0dffaeb5d75eff63dab474f25ceeb09aa1fa89b750
|
@@ -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: x86-mingw32
|
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
|
@@ -1596,6 +1596,7 @@ files:
|
|
1596
1596
|
- spec/functional/knife/smoke_test.rb
|
1597
1597
|
- spec/functional/knife/ssh_spec.rb
|
1598
1598
|
- spec/functional/provider/remote_file/cache_control_data_spec.rb
|
1599
|
+
- spec/functional/provider/whyrun_safe_ruby_block_spec.rb
|
1599
1600
|
- spec/functional/resource/base.rb
|
1600
1601
|
- spec/functional/resource/batch_spec.rb
|
1601
1602
|
- spec/functional/resource/bff_spec.rb
|