summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md7
-rw-r--r--Gemfile.lock14
-rw-r--r--VERSION2
-rw-r--r--chef-bin/lib/chef-bin/version.rb2
-rw-r--r--chef-config/lib/chef-config/version.rb2
-rw-r--r--lib/chef/application/base.rb7
-rw-r--r--lib/chef/application/client.rb8
-rw-r--r--lib/chef/application/solo.rb8
-rw-r--r--lib/chef/version.rb2
-rw-r--r--spec/unit/application/client_spec.rb11
-rw-r--r--spec/unit/application/solo_spec.rb11
-rw-r--r--spec/unit/application_spec.rb2
12 files changed, 44 insertions, 32 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 355cac253f..c33040c18b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,15 +1,16 @@
<!-- usage documentation: http://expeditor-docs.es.chef.io/configuration/changelog/ -->
-<!-- latest_release 15.2.29 -->
-## [v15.2.29](https://github.com/chef/chef/tree/v15.2.29) (2019-08-23)
+<!-- latest_release 15.2.30 -->
+## [v15.2.30](https://github.com/chef/chef/tree/v15.2.30) (2019-08-28)
#### Merged Pull Requests
-- ifconfig: fix regex matching interface name with hyphen [#8756](https://github.com/chef/chef/pull/8756) ([dheerajd-msys](https://github.com/dheerajd-msys))
+- Fail on interval runs on windows as interval runs on Windows don&#39;t entirely work [#6777](https://github.com/chef/chef/pull/6777) ([lamont-granquist](https://github.com/lamont-granquist))
<!-- latest_release -->
<!-- release_rollup since=15.2.20 -->
### Changes not yet released to stable
#### Merged Pull Requests
+- Fail on interval runs on windows as interval runs on Windows don&#39;t entirely work [#6777](https://github.com/chef/chef/pull/6777) ([lamont-granquist](https://github.com/lamont-granquist)) <!-- 15.2.30 -->
- ifconfig: fix regex matching interface name with hyphen [#8756](https://github.com/chef/chef/pull/8756) ([dheerajd-msys](https://github.com/dheerajd-msys)) <!-- 15.2.29 -->
- Add AIX 7.2 platform [#8832](https://github.com/chef/chef/pull/8832) ([jaymalasinha](https://github.com/jaymalasinha)) <!-- 15.2.28 -->
- Fix crash when showing error about missing profile [#8828](https://github.com/chef/chef/pull/8828) ([andrewdotn](https://github.com/andrewdotn)) <!-- 15.2.27 -->
diff --git a/Gemfile.lock b/Gemfile.lock
index 03d5f16835..e197c790df 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -27,11 +27,11 @@ GIT
PATH
remote: .
specs:
- chef (15.2.29)
+ chef (15.2.30)
addressable
bcrypt_pbkdf (~> 1.0)
bundler (>= 1.10)
- chef-config (= 15.2.29)
+ chef-config (= 15.2.30)
chef-zero (>= 14.0.11)
diff-lcs (~> 1.2, >= 1.2.4)
ed25519 (~> 1.2)
@@ -57,11 +57,11 @@ PATH
train-core (~> 2.0, >= 2.0.12)
tty-screen (~> 0.6)
uuidtools (~> 2.1.5)
- chef (15.2.29-universal-mingw32)
+ chef (15.2.30-universal-mingw32)
addressable
bcrypt_pbkdf (~> 1.0)
bundler (>= 1.10)
- chef-config (= 15.2.29)
+ chef-config (= 15.2.30)
chef-zero (>= 14.0.11)
diff-lcs (~> 1.2, >= 1.2.4)
ed25519 (~> 1.2)
@@ -103,13 +103,13 @@ PATH
PATH
remote: chef-bin
specs:
- chef-bin (15.2.29)
- chef (= 15.2.29)
+ chef-bin (15.2.30)
+ chef (= 15.2.30)
PATH
remote: chef-config
specs:
- chef-config (15.2.29)
+ chef-config (15.2.30)
addressable
fuzzyurl
mixlib-config (>= 2.2.12, < 4.0)
diff --git a/VERSION b/VERSION
index 8c7f246e6e..dcdc4154cf 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-15.2.29 \ No newline at end of file
+15.2.30 \ No newline at end of file
diff --git a/chef-bin/lib/chef-bin/version.rb b/chef-bin/lib/chef-bin/version.rb
index c1481dcec4..d648f7fb02 100644
--- a/chef-bin/lib/chef-bin/version.rb
+++ b/chef-bin/lib/chef-bin/version.rb
@@ -21,7 +21,7 @@
module ChefBin
CHEFBIN_ROOT = File.expand_path("../..", __FILE__)
- VERSION = "15.2.29".freeze
+ VERSION = "15.2.30".freeze
end
#
diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb
index c9a9ba2006..42103a5677 100644
--- a/chef-config/lib/chef-config/version.rb
+++ b/chef-config/lib/chef-config/version.rb
@@ -21,7 +21,7 @@
module ChefConfig
CHEFCONFIG_ROOT = File.expand_path("../..", __FILE__)
- VERSION = "15.2.29".freeze
+ VERSION = "15.2.30".freeze
end
#
diff --git a/lib/chef/application/base.rb b/lib/chef/application/base.rb
index fea3d844ce..c5bff9874e 100644
--- a/lib/chef/application/base.rb
+++ b/lib/chef/application/base.rb
@@ -340,6 +340,13 @@ class Chef::Application::Base < Chef::Application
private
+ def windows_interval_error_message
+ "Windows #{Chef::Dist::PRODUCT} interval runs are not supported in #{Chef::Dist::PRODUCT} 15 and later." +
+ "\nConfiguration settings:" +
+ ("\n interval = #{Chef::Config[:interval]} seconds" if Chef::Config[:interval]).to_s +
+ "\nPlease manage #{Chef::Dist::PRODUCT} as a scheduled task instead."
+ end
+
def unforked_interval_error_message
"Unforked #{Chef::Dist::PRODUCT} interval runs are disabled by default." +
"\nConfiguration settings:" +
diff --git a/lib/chef/application/client.rb b/lib/chef/application/client.rb
index 0fc5ca7711..890ecbd385 100644
--- a/lib/chef/application/client.rb
+++ b/lib/chef/application/client.rb
@@ -128,8 +128,12 @@ class Chef::Application::Client < Chef::Application::Base
Chef::Config[:client_fork] = !!Chef::Config[:interval]
end
- if !Chef::Config[:client_fork] && Chef::Config[:interval] && !Chef::Platform.windows?
- Chef::Application.fatal!(unforked_interval_error_message)
+ if Chef::Config[:interval]
+ if Chef::Platform.windows?
+ Chef::Application.fatal!(windows_interval_error_message)
+ elsif !Chef::Config[:client_fork]
+ Chef::Application.fatal!(unforked_interval_error_message)
+ end
end
if Chef::Config[:json_attribs]
diff --git a/lib/chef/application/solo.rb b/lib/chef/application/solo.rb
index bce95c2841..da9ec7f566 100644
--- a/lib/chef/application/solo.rb
+++ b/lib/chef/application/solo.rb
@@ -102,7 +102,13 @@ class Chef::Application::Solo < Chef::Application::Base
Chef::Config[:client_fork] = !!Chef::Config[:interval]
end
- Chef::Application.fatal!(unforked_interval_error_message) if !Chef::Config[:client_fork] && Chef::Config[:interval]
+ if Chef::Config[:interval]
+ if Chef::Platform.windows?
+ Chef::Application.fatal!(windows_interval_error_message)
+ elsif !Chef::Config[:client_fork]
+ Chef::Application.fatal!(unforked_interval_error_message)
+ end
+ end
if Chef::Config[:recipe_url]
cookbooks_path = Array(Chef::Config[:cookbook_path]).detect { |e| Pathname.new(e).cleanpath.to_s =~ %r{/cookbooks/*$} }
diff --git a/lib/chef/version.rb b/lib/chef/version.rb
index d55b5fc8f7..e033f3e909 100644
--- a/lib/chef/version.rb
+++ b/lib/chef/version.rb
@@ -23,7 +23,7 @@ require_relative "version_string"
class Chef
CHEF_ROOT = File.expand_path("../..", __FILE__)
- VERSION = Chef::VersionString.new("15.2.29")
+ VERSION = Chef::VersionString.new("15.2.30")
end
#
diff --git a/spec/unit/application/client_spec.rb b/spec/unit/application/client_spec.rb
index 0773fc70fd..d4ed403197 100644
--- a/spec/unit/application/client_spec.rb
+++ b/spec/unit/application/client_spec.rb
@@ -1,6 +1,6 @@
# Author:: AJ Christensen (<aj@junglist.gen.nz>)
-# Copyright:: Copyright 2008-2018, Chef Software Inc.
+# Copyright:: Copyright 2008-2019, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -85,7 +85,6 @@ describe Chef::Application::Client, "reconfigure" do
allow(app).to receive(:trap)
allow(app).to receive(:configure_logging).and_return(true)
- Chef::Config[:interval] = 10
Chef::Config[:once] = false
@@ -162,7 +161,7 @@ describe Chef::Application::Client, "reconfigure" do
it_behaves_like "sets the configuration", "--no-fork", client_fork: false
end
- context "with an interval" do
+ context "with an interval", :unix_only do
it_behaves_like "sets the configuration", "--interval 1800", client_fork: true
end
@@ -322,7 +321,7 @@ describe Chef::Application::Client, "reconfigure" do
Chef::Config[:splay] = nil
end
- it "should terminal with message when interval is given" do
+ it "should terminate with message when interval is given" do
Chef::Config[:interval] = 600
allow(ChefConfig).to receive(:windows?).and_return(false)
expect(Chef::Application).to receive(:fatal!).with(
@@ -340,8 +339,8 @@ Enable .* interval runs by setting `:client_fork = true` in your config file or
allow(ChefConfig).to receive(:windows?).and_return(true)
end
- it "should not terminate" do
- expect(Chef::Application).not_to receive(:fatal!)
+ it "should terminate" do
+ expect(Chef::Application).to receive(:fatal!)
app.reconfigure
end
end
diff --git a/spec/unit/application/solo_spec.rb b/spec/unit/application/solo_spec.rb
index 3f540d24e2..b70f959ab5 100644
--- a/spec/unit/application/solo_spec.rb
+++ b/spec/unit/application/solo_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: AJ Christensen (<aj@junglist.gen.nz>)
-# Copyright:: Copyright 2008-2018, Chef Software Inc.
+# Copyright:: Copyright 2008-2019, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -64,18 +64,13 @@ describe Chef::Application::Solo do
end
it "should terminate with message" do
- expect(Chef::Application).to receive(:fatal!).with(
- /Unforked .* interval runs are disabled by default\.
-Configuration settings:
- interval = 600 seconds
-Enable .* interval runs by setting `:client_fork = true` in your config file or adding `--fork` to your command line options\./
- )
+ expect(Chef::Application).to receive(:fatal!).with(/interval runs are (disabled|not supported)/)
app.reconfigure
end
end
end
- describe "when in daemonized mode and no interval has been set" do
+ describe "when in daemonized mode and no interval has been set", :unix_only do
before do
Chef::Config[:daemonize] = true
end
diff --git a/spec/unit/application_spec.rb b/spec/unit/application_spec.rb
index e94f9b74ae..7a787d1f3f 100644
--- a/spec/unit/application_spec.rb
+++ b/spec/unit/application_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: AJ Christensen (<aj@junglist.gen.nz>)
# Author:: Mark Mzyk (mmzyk@chef.io)
-# Copyright:: Copyright 2008-2018, Chef Software Inc.
+# Copyright:: Copyright 2008-2019, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");