chef 11.12.2 → 11.12.4.rc.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chef/knife/configure.rb +2 -1
- data/lib/chef/provider/service/macosx.rb +5 -1
- data/lib/chef/version.rb +1 -1
- data/spec/functional/knife/configure_spec.rb +38 -0
- data/spec/unit/knife/configure_spec.rb +1 -0
- data/spec/unit/provider/service/macosx_spec.rb +37 -0
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3f91d427e2c9bdfd5c793e2395141833b9b0a7c
|
4
|
+
data.tar.gz: 41696e378a4606f264e53fd44e1edd048aebf3bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c958aa132098b374c4b113974d965d59ca633c8e072e6aca92889191998574c7135f60975cdac85705244de5eb710d2237f71d1d1835d35f9fd6024bdad5495e
|
7
|
+
data.tar.gz: a997f28d05a3a7ffbef27bb041be4859ca5d7982d15e94b323a0a50a26e364a629da97d80791eb6d7e145aaf29eb13ce2219aa86cacec8dd47217753780a4306
|
data/lib/chef/knife/configure.rb
CHANGED
@@ -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(:
|
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
@@ -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
|
@@ -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: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Jacob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
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:
|
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:
|
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
|
@@ -1403,6 +1403,7 @@ files:
|
|
1403
1403
|
- spec/functional/dsl/reboot_pending_spec.rb
|
1404
1404
|
- spec/functional/dsl/registry_helper_spec.rb
|
1405
1405
|
- spec/functional/file_content_management/deploy_strategies_spec.rb
|
1406
|
+
- spec/functional/knife/configure_spec.rb
|
1406
1407
|
- spec/functional/knife/cookbook_delete_spec.rb
|
1407
1408
|
- spec/functional/knife/exec_spec.rb
|
1408
1409
|
- spec/functional/knife/smoke_test.rb
|
@@ -1858,9 +1859,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1858
1859
|
version: '0'
|
1859
1860
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1860
1861
|
requirements:
|
1861
|
-
- - "
|
1862
|
+
- - ">"
|
1862
1863
|
- !ruby/object:Gem::Version
|
1863
|
-
version:
|
1864
|
+
version: 1.3.1
|
1864
1865
|
requirements: []
|
1865
1866
|
rubyforge_project:
|
1866
1867
|
rubygems_version: 2.2.2
|