chef 11.12.2-x86-mingw32 → 11.12.4.rc.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: e8569627190d2efc4f966d9a016c1816bc865826
4
- data.tar.gz: 158cc0a37657509979c45c548fc62554a9819444
3
+ metadata.gz: 79d3e31e9197b7e03a2ac14f710896d028b96316
4
+ data.tar.gz: fd899c3989fae6b26739fda6668fb57c467873d8
5
5
  SHA512:
6
- metadata.gz: ca943559b89c38f60aec250a527ce38f7d2aac0f76e4c1dab2de78986b7612660aa614d7f3cc4f09803446520d7f2698cd4aa7a705708e7585c8f2c77c71b13c
7
- data.tar.gz: 00b109ada95a45d2782b105fd6c596aab4597638e8ae04c556c34b22a12c63630377ee80389841581b3aa8f90defff897f0e6d97c8166058d552af4cecb54c0f
6
+ metadata.gz: 035f800e4b3832eac54bd2f3c97088ebda68900ebef1b8df6de61a6c469d3650cb932c1749bd7f4482d1493032d89c43ee22ee75c29c72d49b70735c58261a6a
7
+ data.tar.gz: fb35b463e148037a58dcb0f29c6da7d0c1e19b964ff2e7874600a51ed82b2b5202b81c1d65c6fc29b18ded5f266c7ccdc754db33e71a0cdd8eb39cfc7c814774
@@ -153,9 +153,10 @@ EOH
153
153
 
154
154
  def guess_servername
155
155
  o = Ohai::System.new
156
+ o.load_plugins
156
157
  o.require_plugin 'os'
157
158
  o.require_plugin 'hostname'
158
- o[:fqdn] || 'localhost'
159
+ o[:fqdn] || o[:machinename] || o[:hostname] || 'localhost'
159
160
  end
160
161
 
161
162
  def config_file
@@ -59,7 +59,7 @@ class Chef
59
59
  a.failure_message Chef::Exceptions::Service, "Several plist files match service name. Please use full service name."
60
60
  end
61
61
 
62
- requirements.assert(:all_actions) do |a|
62
+ requirements.assert(:enable, :disable) do |a|
63
63
  a.assertion { !@service_label.to_s.empty? }
64
64
  a.failure_message Chef::Exceptions::Service,
65
65
  "Could not find service's label in plist file '#{@plist}'!"
@@ -172,6 +172,10 @@ class Chef
172
172
  private
173
173
 
174
174
  def find_service_label
175
+ # CHEF-5223 "you can't glob for a file that hasn't been converged
176
+ # onto the node yet."
177
+ return nil if @plist.nil?
178
+
175
179
  # Most services have the same internal label as the name of the
176
180
  # plist file. However, there is no rule saying that *has* to be
177
181
  # the case, and some core services (notably, ssh) do not follow
data/lib/chef/version.rb CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
  class Chef
19
19
  CHEF_ROOT = File.dirname(File.expand_path(File.dirname(__FILE__)))
20
- VERSION = '11.12.2'
20
+ VERSION = '11.12.4.rc.2'
21
21
  end
22
22
 
23
23
  # NOTE: the Chef::Version class is defined in version_class.rb
@@ -0,0 +1,38 @@
1
+ #
2
+ # Author:: Bryan McLellan <btm@loftninjas.org>
3
+ # Copyright:: Copyright (c) 2014 Chef Software, 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
+ require 'chef/knife/configure'
22
+ require 'ohai'
23
+
24
+ describe "knife configure" do
25
+ let (:ohai) do
26
+ o = Ohai::System.new
27
+ o.load_plugins
28
+ o.require_plugin 'os'
29
+ o.require_plugin 'hostname'
30
+ o
31
+ end
32
+
33
+ it "loads the fqdn from Ohai" do
34
+ knife_configure = Chef::Knife::Configure.new
35
+ hostname_guess = ohai[:fqdn] || ohai[:machinename] || ohai[:hostname] || 'localhost'
36
+ expect(knife_configure.guess_servername).to eql(hostname_guess)
37
+ end
38
+ end
@@ -28,6 +28,7 @@ describe Chef::Knife::Configure do
28
28
  let(:ohai) do
29
29
  o = {}
30
30
  o.stub(:require_plugin)
31
+ o.stub(:load_plugins)
31
32
  o[:fqdn] = fqdn
32
33
  o
33
34
  end
@@ -81,6 +81,43 @@ XML
81
81
  let!(:current_resource) { Chef::Resource::Service.new(service_name) }
82
82
 
83
83
  describe "#load_current_resource" do
84
+
85
+ # CHEF-5223 "you can't glob for a file that hasn't been converged
86
+ # onto the node yet."
87
+ context "when the plist doesn't exist" do
88
+
89
+ def run_resource_setup_for_action(action)
90
+ new_resource.action(action)
91
+ provider.action = action
92
+ provider.load_current_resource
93
+ provider.define_resource_requirements
94
+ provider.process_resource_requirements
95
+ end
96
+
97
+ before do
98
+ Dir.stub(:glob).and_return([])
99
+ provider.stub(:shell_out!).
100
+ with(/plutil -convert xml1 -o/).
101
+ and_raise(Mixlib::ShellOut::ShellCommandFailed)
102
+ end
103
+
104
+ it "works for action :nothing" do
105
+ lambda { run_resource_setup_for_action(:nothing) }.should_not raise_error
106
+ end
107
+
108
+ it "works for action :start" do
109
+ lambda { run_resource_setup_for_action(:start) }.should_not raise_error
110
+ end
111
+
112
+ it "errors if action is :enable" do
113
+ lambda { run_resource_setup_for_action(:enable) }.should raise_error(Chef::Exceptions::Service)
114
+ end
115
+
116
+ it "errors if action is :disable" do
117
+ lambda { run_resource_setup_for_action(:disable) }.should raise_error(Chef::Exceptions::Service)
118
+ end
119
+ end
120
+
84
121
  context "when launchctl returns pid in service list" do
85
122
  let(:launchctl_stdout) { StringIO.new <<-SVC_LIST }
86
123
  12761 - 0x100114220.old.machinit.thing
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.12.2
4
+ version: 11.12.4.rc.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-04-10 00:00:00.000000000 Z
11
+ date: 2014-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-config
@@ -84,16 +84,16 @@ dependencies:
84
84
  name: ohai
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: '7.0'
89
+ version: 7.0.4.rc.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: '7.0'
96
+ version: 7.0.4.rc.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rest-client
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -1557,6 +1557,7 @@ files:
1557
1557
  - spec/functional/dsl/reboot_pending_spec.rb
1558
1558
  - spec/functional/dsl/registry_helper_spec.rb
1559
1559
  - spec/functional/file_content_management/deploy_strategies_spec.rb
1560
+ - spec/functional/knife/configure_spec.rb
1560
1561
  - spec/functional/knife/cookbook_delete_spec.rb
1561
1562
  - spec/functional/knife/exec_spec.rb
1562
1563
  - spec/functional/knife/smoke_test.rb
@@ -2012,9 +2013,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
2012
2013
  version: '0'
2013
2014
  required_rubygems_version: !ruby/object:Gem::Requirement
2014
2015
  requirements:
2015
- - - ">="
2016
+ - - ">"
2016
2017
  - !ruby/object:Gem::Version
2017
- version: '0'
2018
+ version: 1.3.1
2018
2019
  requirements: []
2019
2020
  rubyforge_project:
2020
2021
  rubygems_version: 2.2.2