summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jacob <adam@hjksolutions.com>2009-04-29 15:13:45 -0700
committerAdam Jacob <adam@hjksolutions.com>2009-04-29 15:13:45 -0700
commit7ebaaa462c63d7b5a36b47b0c13a013c0d6d7bec (patch)
tree0692206a3da19eb7eba119bfdb80433da0821fd7
parent98831d379562b84c2fb68e091ef6cfb711efe84b (diff)
parent5ad81e5cf7a81330fd475e396cb1ebe7f1b26b2b (diff)
downloadchef-7ebaaa462c63d7b5a36b47b0c13a013c0d6d7bec.tar.gz
Merge branch 'master' into dbalatero/chef-258
-rw-r--r--CHANGELOG55
-rw-r--r--Rakefile11
-rw-r--r--chef-server-slice/Rakefile2
-rw-r--r--chef-server/Rakefile2
-rw-r--r--chef/Rakefile2
-rwxr-xr-xchef/bin/chef-client9
-rw-r--r--chef/lib/chef.rb2
-rw-r--r--chef/lib/chef/mixin/command.rb1
-rw-r--r--features/chef-client/run_interval.feature12
-rw-r--r--features/data/cookbooks/run_interval/recipes/default.rb18
-rw-r--r--features/steps/run_client.rb44
11 files changed, 140 insertions, 18 deletions
diff --git a/CHANGELOG b/CHANGELOG
index d9d9fa95ef..7679205187 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,58 @@
+Tue Apr 28 16:43:43 PDT 2009
+Release Notes - Chef - Version 0.6.0
+http://tickets.opscode.com
+
+** Bug
+ * [CHEF-134] - User IDs and GIDs with negative numbers cause a type exception
+ * [CHEF-162] - delayed notifications should coalesce so they don't run multiple times
+ * [CHEF-163] - remote_file not working on head, 404 due to missing route
+ * [CHEF-164] - Slice routing changes break remote file provider
+ * [CHEF-169] - Detect and use new view URL's for CouchDB 0.9.0 compatability
+ * [CHEF-171] - Package name with a dash (-) in it is not recognised
+ * [CHEF-173] - With debug logging level set long running commands do not show their output in real time
+ * [CHEF-174] - directory mode not set correctly
+ * [CHEF-182] - Chef::Exception masks ::Exception (see OHAI-79)
+ * [CHEF-185] - file delete backs up links
+ * [CHEF-186] - file delete fails if file does not exist
+ * [CHEF-188] - Merb dependencies for both the server app and slice need to be updated to 1.0.10
+ * [CHEF-190] - apt provider fails on non-English debian installations
+ * [CHEF-195] - The backup attribute for File needlessly creates a backup then deletes it when set to 0
+ * [CHEF-198] - chef-solo banner
+ * [CHEF-206] - chef-server-slice rake install fails
+ * [CHEF-207] - chef-server and chef-server-slice should require merb > 1.0, not specific versions
+ * [CHEF-218] - Search indexes are broken due to missing route
+ * [CHEF-222] - CouchDB 0.9 compat causes the client to attempt a connection to the CouchDB server (while instantiating a node object)
+ * [CHEF-227] - Delete operation of Search Index is not working
+ * [CHEF-228] - chef-server under passenger: Controller class not found for controller `registrations'
+ * [CHEF-230] - remote_file with a url should include a type of hash option to verify the downloaded file is what we expected
+ * [CHEF-237] - Apt provider won't install msttcorefonts
+ * [CHEF-238] - Commands with over 4k of output will block forever
+ * [CHEF-244] - Chef server no longer checks openid's against the authorized_openid_identifiers configuration
+
+** Improvement
+ * [CHEF-54] - chef-server should be a merb slice
+ * [CHEF-129] - Implement pilu's web-app-theme for chef-server
+ * [CHEF-148] - cookbook naming and routing
+ * [CHEF-153] - Allow access to a list of OpenID's via configration.
+ * [CHEF-159] - CookbookLoader#load_cascading_files uses Dir.glob(array) syntax, which is unavailable on RHEL and Centos
+ * [CHEF-167] - chef-server-slice rake install requires sudo
+ * [CHEF-172] - In FreeBSD package provider simplify source parameter "magic" by using PKGNAME in ports Makefile
+ * [CHEF-177] - Where multiple ports have the same name allow path to ports to be given
+ * [CHEF-192] - speed up yum provider
+ * [CHEF-200] - fixes from centos packaging attempt
+ * [CHEF-210] - enterprise linux init scripts and configs
+ * [CHEF-213] - Fixing typos in the code
+ * [CHEF-214] - On Gentoo, services always support the :status command, so enable it by default
+ * [CHEF-246] - Should be clearer what tags are attached to a node
+ * [CHEF-247] - Let chef-server and chef-client compare checksums in bulk rather than one at a time.
+
+** New Feature
+ * [CHEF-78] - Add a mixin for parsing a file and replacing lines
+ * [CHEF-176] - Chef status page that displays basic info about each chef managed node
+ * [CHEF-191] - Enable optional CouchDB storage for OpenID associations and nonces
+ * [CHEF-216] - Allow execute/script resources to set umask
+
+
Thu Mar 5 19:51:02 PST 2009
Release Notes - Chef - Version 0.5.6
http://tickets.opscode.com
diff --git a/Rakefile b/Rakefile
index 781675e2b7..01669283c5 100644
--- a/Rakefile
+++ b/Rakefile
@@ -2,22 +2,15 @@ gems = %w[chef chef-server-slice chef-server]
require 'rubygems'
require 'cucumber/rake/task'
-namespace :git do
- desc "Initialise and update the Git submodules"
- task :submodule_update do
- sh "git submodule update --init"
- end
-end
-
desc "Build the chef gems"
-task :gem => "git:submodule_update" do
+task :gem do
gems.each do |dir|
Dir.chdir(dir) { sh "rake package" }
end
end
desc "Install the chef gems"
-task :install => "git:submodule_update" do
+task :install do
gems.each do |dir|
Dir.chdir(dir) { sh "rake install" }
end
diff --git a/chef-server-slice/Rakefile b/chef-server-slice/Rakefile
index 64d958ee0b..b063538efa 100644
--- a/chef-server-slice/Rakefile
+++ b/chef-server-slice/Rakefile
@@ -5,7 +5,7 @@ require 'merb-core'
require 'merb-core/tasks/merb'
GEM_NAME = "chef-server-slice"
-CHEF_SERVER_VERSION="0.5.7"
+CHEF_SERVER_VERSION="0.6.0"
AUTHOR = "Opscode"
EMAIL = "chef@opscode.com"
HOMEPAGE = "http://wiki.opscode.com/display/chef"
diff --git a/chef-server/Rakefile b/chef-server/Rakefile
index 5110874f41..9c193b4283 100644
--- a/chef-server/Rakefile
+++ b/chef-server/Rakefile
@@ -18,7 +18,7 @@ require 'chef' unless defined?(Chef)
include FileUtils
GEM = "chef-server"
-CHEF_SERVER_VERSION = "0.5.7"
+CHEF_SERVER_VERSION = "0.6.0"
AUTHOR = "Opscode"
EMAIL = "chef@opscode.com"
HOMEPAGE = "http://wiki.opscode.com/display/chef"
diff --git a/chef/Rakefile b/chef/Rakefile
index 89f4527b54..d38a994ddd 100644
--- a/chef/Rakefile
+++ b/chef/Rakefile
@@ -4,7 +4,7 @@ require 'rake/rdoctask'
require './tasks/rspec.rb'
GEM = "chef"
-CHEF_VERSION = "0.5.7"
+CHEF_VERSION = "0.6.0"
AUTHOR = "Adam Jacob"
EMAIL = "adam@opscode.com"
HOMEPAGE = "http://wiki.opscode.com/display/chef"
diff --git a/chef/bin/chef-client b/chef/bin/chef-client
index f960794c5d..84845edfff 100755
--- a/chef/bin/chef-client
+++ b/chef/bin/chef-client
@@ -85,12 +85,15 @@ Chef::Daemon.change_privilege
Chef::Log.init(Chef::Config[:log_location])
Chef::Log.level(Chef::Config[:log_level])
-Chef::Config[:delay] = 0
+Chef::Config[:delay] = 0
if Chef::Config[:daemonize]
# We want to set the interval to half an hour, if one is not set.
Chef::Config[:interval] ||= 1800
Chef::Daemon.daemonize("chef-client")
+end
+
+if Chef::Config[:interval]
Chef::Config[:delay] = Chef::Config[:interval].to_i + (Chef::Config[:splay] ? rand(Chef::Config[:splay]) : 0)
end
@@ -101,7 +104,7 @@ loop do
c.validation_token = Chef::Config[:validation_token]
c.node_name = Chef::Config[:node_name]
c.run
- if Chef::Config[:daemonize]
+ if Chef::Config[:interval]
Chef::Log.debug("Sleeping for #{Chef::Config[:delay]} seconds")
sleep Chef::Config[:delay]
else
@@ -110,7 +113,7 @@ loop do
rescue SystemExit => e
raise
rescue Exception => e
- if Chef::Config[:daemonize]
+ if Chef::Config[:interval]
Chef::Log.error("#{e.class}")
Chef::Log.fatal("#{e}\n#{e.backtrace.join("\n")}")
Chef::Log.fatal("Sleeping for #{Chef::Config[:delay]} seconds before trying again")
diff --git a/chef/lib/chef.rb b/chef/lib/chef.rb
index 57457149c5..f78c60e099 100644
--- a/chef/lib/chef.rb
+++ b/chef/lib/chef.rb
@@ -27,7 +27,7 @@ require 'chef/config'
Dir[File.join(File.dirname(__FILE__), 'chef/mixin/**/*.rb')].sort.each { |lib| require lib }
class Chef
- VERSION = '0.5.7'
+ VERSION = '0.6.0'
class << self
def fatal!(msg, err = -1)
diff --git a/chef/lib/chef/mixin/command.rb b/chef/lib/chef/mixin/command.rb
index 623c2255e1..857e8a41ad 100644
--- a/chef/lib/chef/mixin/command.rb
+++ b/chef/lib/chef/mixin/command.rb
@@ -294,7 +294,6 @@ class Chef
stdout.fcntl(Fcntl::F_SETFL, pi[1].fcntl(Fcntl::F_GETFL) | Fcntl::O_NONBLOCK)
stderr.fcntl(Fcntl::F_SETFL, pi[2].fcntl(Fcntl::F_GETFL) | Fcntl::O_NONBLOCK)
-
stdout_finished = false
stderr_finished = false
diff --git a/features/chef-client/run_interval.feature b/features/chef-client/run_interval.feature
new file mode 100644
index 0000000000..e2dd91425e
--- /dev/null
+++ b/features/chef-client/run_interval.feature
@@ -0,0 +1,12 @@
+Feature: Run chef-client at periodic intervals
+ In order to ensure a system is always correctly configured
+ As an Administrator
+ I want to run the chef-client repeatedly at an interval
+
+ Scenario: Run the client at an interval
+ Given a validated node
+ And it includes the recipe 'run_interval'
+ When I run the chef-client with '-l info -i 5' for '10' seconds
+ Then the run should exit from being signaled
+ And 'INFO: Starting Chef Run' should appear on 'stdout' '2' times
+
diff --git a/features/data/cookbooks/run_interval/recipes/default.rb b/features/data/cookbooks/run_interval/recipes/default.rb
new file mode 100644
index 0000000000..4b7f432de2
--- /dev/null
+++ b/features/data/cookbooks/run_interval/recipes/default.rb
@@ -0,0 +1,18 @@
+#
+# Cookbook Name:: run_interval
+# Recipe:: default
+#
+# Copyright 2009, Opscode
+#
+# 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.
+#
diff --git a/features/steps/run_client.rb b/features/steps/run_client.rb
index 6c295d9fb3..62249daa7d 100644
--- a/features/steps/run_client.rb
+++ b/features/steps/run_client.rb
@@ -21,15 +21,36 @@
###
When /^I run the chef\-client$/ do
@log_level ||= ENV["LOG_LEVEL"] ? ENV["LOG_LEVEL"] : "error"
+ @chef_args ||= ""
@config_file ||= File.expand_path(File.join(File.dirname(__FILE__), '..', 'data', 'config', 'client.rb'))
status = Chef::Mixin::Command.popen4(
- "chef-client -l #{@log_level} -c #{@config_file}") do |p, i, o, e|
+ "chef-client -l #{@log_level} -c #{@config_file} #{@chef_args}") do |p, i, o, e|
@stdout = o.gets(nil)
@stderr = e.gets(nil)
end
@status = status
end
+When /^I run the chef\-client with '(.+)'$/ do |args|
+ @chef_args = args
+ When "I run the chef-client"
+end
+
+When /^I run the chef\-client with '(.+)' for '(.+)' seconds$/ do |args, run_for|
+ @chef_args = args
+ When "I run the chef-client for '#{run_for}' seconds"
+end
+
+When /^I run the chef\-client for '(.+)' seconds$/ do |run_for|
+ cid = fork {
+ sleep run_for.to_i
+ client_pid = `ps ax | grep chef-client | grep -v grep | grep -v rake | grep -v cucumber | awk '{ print $1 }'`
+ Process.kill("KILL", client_pid.to_i)
+ }
+ When 'I run the chef-client'
+ Process.waitpid2(cid)
+end
+
When /^I run the chef\-client at log level '(.+)'$/ do |log_level|
@log_level = log_level
When "I run the chef-client"
@@ -77,6 +98,8 @@ end
# Then
###
Then /^the run should exit '(.+)'$/ do |exit_code|
+ puts @status.inspect
+ puts @status.exitstatus
begin
@status.exitstatus.should eql(exit_code.to_i)
rescue
@@ -86,6 +109,17 @@ Then /^the run should exit '(.+)'$/ do |exit_code|
print_output if ENV["LOG_LEVEL"] == "debug"
end
+Then /^the run should exit from being signaled$/ do
+ begin
+ @status.signaled?.should == true
+ rescue
+ print_output
+ raise
+ end
+ print_output if ENV["LOG_LEVEL"] == "debug"
+end
+
+
def print_output
puts "--- run stdout:"
puts @stdout
@@ -101,3 +135,11 @@ Then /^'(.+)' should not have '(.+)'$/ do |which, to_match|
self.instance_variable_get("@#{which}".to_sym).should_not match(/#{to_match}/m)
end
+Then /^'(.+)' should appear on '(.+)' '(.+)' times$/ do |to_match, which, count|
+ seen_count = 0
+ self.instance_variable_get("@#{which}".to_sym).split("\n").each do |line|
+ seen_count += 1 if line =~ /#{to_match}/
+ end
+ seen_count.should == count.to_i
+end
+