diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/application/client.rb | 12 | ||||
-rw-r--r-- | lib/chef/application/solo.rb | 12 |
2 files changed, 18 insertions, 6 deletions
diff --git a/lib/chef/application/client.rb b/lib/chef/application/client.rb index f4a42ea1b0..f839ef25df 100644 --- a/lib/chef/application/client.rb +++ b/lib/chef/application/client.rb @@ -2,7 +2,7 @@ # Author:: AJ Christensen (<aj@chef.io) # Author:: Christopher Brown (<cb@chef.io>) # Author:: Mark Mzyk (mmzyk@chef.io) -# Copyright:: Copyright 2008-2016, Chef Software, Inc. +# Copyright:: Copyright 2008-2018, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -362,8 +362,7 @@ class Chef::Application::Client < Chef::Application if Chef::Config[:interval] if Chef::Platform.windows? - Chef::Log.warn("Use of chef-client interval runs on Windows is discouraged. " + - "Please install chef-client as a Windows service or scheduled task instead.") + Chef::Application.fatal!(windows_interval_error_message) elsif !Chef::Config[:client_fork] Chef::Application.fatal!(unforked_interval_error_message) end @@ -513,6 +512,13 @@ class Chef::Application::Client < Chef::Application end end + def windows_interval_error_message + "Windows chef-client interval runs are disabled in Chef 14." + + "\nConfiguration settings:" + + "#{"\n interval = #{Chef::Config[:interval]} seconds" if Chef::Config[:interval]}" + + "\nPlease install chef-client as a Windows service or scheduled task instead." + end + def unforked_interval_error_message "Unforked chef-client interval runs are disabled in Chef 12." + "\nConfiguration settings:" + diff --git a/lib/chef/application/solo.rb b/lib/chef/application/solo.rb index 63d90f0e03..b255951e3f 100644 --- a/lib/chef/application/solo.rb +++ b/lib/chef/application/solo.rb @@ -1,7 +1,7 @@ # # Author:: AJ Christensen (<aj@chef.io>) # Author:: Mark Mzyk (mmzyk@chef.io) -# Copyright:: Copyright 2008-2018, Chef Software, Inc. +# Copyright:: Copyright 2008-2018, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -263,8 +263,7 @@ class Chef::Application::Solo < Chef::Application if Chef::Config[:interval] if Chef::Platform.windows? - Chef::Log.warn("Use of chef-solo interval runs on Windows is discouraged. " + - "Please install chef-solo as a Windows service or scheduled task instead.") + Chef::Application.fatal!(windows_interval_error_message) elsif !Chef::Config[:client_fork] Chef::Application.fatal!(unforked_interval_error_message) end @@ -370,6 +369,13 @@ EOH end end + def windows_interval_error_message + "Windows chef-solo interval runs are disabled in Chef 14." + + "\nConfiguration settings:" + + "#{"\n interval = #{Chef::Config[:interval]} seconds" if Chef::Config[:interval]}" + + "\nPlease install chef-solo as a Windows service or scheduled task instead." + end + def unforked_interval_error_message "Unforked chef-solo interval runs are disabled in Chef 12." + "\nConfiguration settings:" + |