Commit 2e9367e6 authored by Adam Edwards's avatar Adam Edwards
Browse files

Merge pull request #1388 from opscode/adamed/11-stable

Merge for release 11.12.4.rc.0
parents 03f827b5 5982d897
# Chef Client Changelog # Chef Client Changelog
## Unreleased: 11.12.2 ## Unreleased 11.12.4 RC0 (4/22/2014)
* Fix OS X service provider actions that don't require the service label
to work when there is no plist. (CHEF-5223)
* CHEF-5211: 'knife configure --initial' fails to load 'os' and 'hostname'
ohai plugins properly
## Last Release: 11.12.2 (4/9/2014)
* Fix the order of middlewares in HTTP::Simple (CHEF-5198). * Fix the order of middlewares in HTTP::Simple (CHEF-5198).
* Wrap code in block context when syntax checking so `return` is valid (CHEF-5199). * Wrap code in block context when syntax checking so `return` is valid (CHEF-5199).
## Last Release: 11.12.0 (4/8/2014) ## Release: 11.12.0 (4/8/2014)
* Including a recipe from a cookbook not in the dependency graph logs * Including a recipe from a cookbook not in the dependency graph logs
a MissingCookbookDependency warning. Fixes CHEF-4367. a MissingCookbookDependency warning. Fixes CHEF-4367.
......
...@@ -192,6 +192,14 @@ Normally Chef would require a major version bump for this change but since the o ...@@ -192,6 +192,14 @@ Normally Chef would require a major version bump for this change but since the o
If you need to differentiate between OpenSUSE and SUSE in your cookbooks, please make sure the differentiation logic is updated to use the new :platform attribute values rather than the :platform_version in your cookbooks before upgrading to this version. If you need to differentiate between OpenSUSE and SUSE in your cookbooks, please make sure the differentiation logic is updated to use the new :platform attribute values rather than the :platform_version in your cookbooks before upgrading to this version.
#### CHEF-5223 OS X Service provider regression.
This commit: https://github.com/opscode/chef/commit/024b1e3e4de523d3c1ebbb42883a2bef3f9f415c
introduced a requirement that a service have a plist file for any
action, but a service that is being created will not have a plist file
yet. Chef now only requires that a service have a plist for the enable
and disable actions.
#### Signal Regression Fix #### Signal Regression Fix
CHEF-1761 introduced a regression for signal handling when not in daemon mode CHEF-1761 introduced a regression for signal handling when not in daemon mode
......
...@@ -153,6 +153,7 @@ EOH ...@@ -153,6 +153,7 @@ EOH
def guess_servername def guess_servername
o = Ohai::System.new o = Ohai::System.new
o.load_plugins
o.require_plugin 'os' o.require_plugin 'os'
o.require_plugin 'hostname' o.require_plugin 'hostname'
o[:fqdn] || 'localhost' o[:fqdn] || 'localhost'
......
...@@ -59,7 +59,7 @@ class Chef ...@@ -59,7 +59,7 @@ class Chef
a.failure_message Chef::Exceptions::Service, "Several plist files match service name. Please use full service name." a.failure_message Chef::Exceptions::Service, "Several plist files match service name. Please use full service name."
end end
requirements.assert(:all_actions) do |a| requirements.assert(:enable, :disable) do |a|
a.assertion { !@service_label.to_s.empty? } a.assertion { !@service_label.to_s.empty? }
a.failure_message Chef::Exceptions::Service, a.failure_message Chef::Exceptions::Service,
"Could not find service's label in plist file '#{@plist}'!" "Could not find service's label in plist file '#{@plist}'!"
...@@ -172,6 +172,10 @@ class Chef ...@@ -172,6 +172,10 @@ class Chef
private private
def find_service_label def find_service_label
# CHEF-5223 "you can't glob for a file that hasn't been converged
# onto the node yet."
return nil if @plist.nil?
# Most services have the same internal label as the name of the # Most services have the same internal label as the name of the
# plist file. However, there is no rule saying that *has* to be # plist file. However, there is no rule saying that *has* to be
# the case, and some core services (notably, ssh) do not follow # the case, and some core services (notably, ssh) do not follow
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
class Chef class Chef
CHEF_ROOT = File.dirname(File.expand_path(File.dirname(__FILE__))) CHEF_ROOT = File.dirname(File.expand_path(File.dirname(__FILE__)))
VERSION = '11.12.2' VERSION = '11.12.4.rc.0'
end end
# NOTE: the Chef::Version class is defined in version_class.rb # NOTE: the Chef::Version class is defined in version_class.rb
#
# Author:: Bryan McLellan <btm@loftninjas.org>
# Copyright:: Copyright (c) 2014 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
require 'spec_helper'
require 'chef/knife/configure'
require 'ohai'
describe "knife configure" do
let (:ohai) do
o = Ohai::System.new
o.load_plugins
o.require_plugin 'os'
o.require_plugin 'hostname'
o
end
it "loads the fqdn from Ohai" do
knife_configure = Chef::Knife::Configure.new
expect(knife_configure.guess_servername).to eql(ohai[:fqdn])
end
end
...@@ -28,6 +28,7 @@ describe Chef::Knife::Configure do ...@@ -28,6 +28,7 @@ describe Chef::Knife::Configure do
let(:ohai) do let(:ohai) do
o = {} o = {}
o.stub(:require_plugin) o.stub(:require_plugin)
o.stub(:load_plugins)
o[:fqdn] = fqdn o[:fqdn] = fqdn
o o
end end
......
...@@ -81,6 +81,43 @@ XML ...@@ -81,6 +81,43 @@ XML
let!(:current_resource) { Chef::Resource::Service.new(service_name) } let!(:current_resource) { Chef::Resource::Service.new(service_name) }
describe "#load_current_resource" do describe "#load_current_resource" do
# CHEF-5223 "you can't glob for a file that hasn't been converged
# onto the node yet."
context "when the plist doesn't exist" do
def run_resource_setup_for_action(action)
new_resource.action(action)
provider.action = action
provider.load_current_resource
provider.define_resource_requirements
provider.process_resource_requirements
end
before do
Dir.stub(:glob).and_return([])
provider.stub(:shell_out!).
with(/plutil -convert xml1 -o/).
and_raise(Mixlib::ShellOut::ShellCommandFailed)
end
it "works for action :nothing" do
lambda { run_resource_setup_for_action(:nothing) }.should_not raise_error
end
it "works for action :start" do
lambda { run_resource_setup_for_action(:start) }.should_not raise_error
end
it "errors if action is :enable" do
lambda { run_resource_setup_for_action(:enable) }.should raise_error(Chef::Exceptions::Service)
end
it "errors if action is :disable" do
lambda { run_resource_setup_for_action(:disable) }.should raise_error(Chef::Exceptions::Service)
end
end
context "when launchctl returns pid in service list" do context "when launchctl returns pid in service list" do
let(:launchctl_stdout) { StringIO.new <<-SVC_LIST } let(:launchctl_stdout) { StringIO.new <<-SVC_LIST }
12761 - 0x100114220.old.machinit.thing 12761 - 0x100114220.old.machinit.thing
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment