diff options
-rw-r--r-- | lib/chef/resource/chef_client_cron.rb | 2 | ||||
-rw-r--r-- | lib/chef/resource/chef_client_launchd.rb | 2 | ||||
-rw-r--r-- | lib/chef/resource/chef_client_scheduled_task.rb | 2 | ||||
-rw-r--r-- | lib/chef/run_context.rb | 2 | ||||
-rw-r--r-- | spec/unit/resource/chef_client_cron_spec.rb | 5 | ||||
-rw-r--r-- | spec/unit/resource/chef_client_launchd_spec.rb | 5 | ||||
-rw-r--r-- | spec/unit/resource/chef_client_scheduled_task_spec.rb | 5 | ||||
-rw-r--r-- | spec/unit/resource/chef_client_systemd_timer_spec.rb | 2 |
8 files changed, 20 insertions, 5 deletions
diff --git a/lib/chef/resource/chef_client_cron.rb b/lib/chef/resource/chef_client_cron.rb index 26894c5ae3..b5014a368d 100644 --- a/lib/chef/resource/chef_client_cron.rb +++ b/lib/chef/resource/chef_client_cron.rb @@ -98,7 +98,7 @@ class Chef property :splay, [Integer, String], default: 300, coerce: proc { |x| Integer(x) }, - callbacks: { "should be a positive number" => proc { |v| v > 0 } }, + callbacks: { "should be a positive number" => proc { |v| v >= 0 } }, description: "A random number of seconds between 0 and X to add to interval so that all #{ChefUtils::Dist::Infra::CLIENT} commands don't execute at the same time." property :mailto, String, diff --git a/lib/chef/resource/chef_client_launchd.rb b/lib/chef/resource/chef_client_launchd.rb index 1016ea4d49..035f2353b7 100644 --- a/lib/chef/resource/chef_client_launchd.rb +++ b/lib/chef/resource/chef_client_launchd.rb @@ -60,7 +60,7 @@ class Chef property :splay, [Integer, String], default: 300, coerce: proc { |x| Integer(x) }, - callbacks: { "should be a positive number" => proc { |v| v > 0 } }, + callbacks: { "should be a positive number" => proc { |v| v >= 0 } }, description: "A random number of seconds between 0 and X to add to interval so that all #{ChefUtils::Dist::Infra::CLIENT} commands don't execute at the same time." property :accept_chef_license, [true, false], diff --git a/lib/chef/resource/chef_client_scheduled_task.rb b/lib/chef/resource/chef_client_scheduled_task.rb index 422881deb8..f04598cdc6 100644 --- a/lib/chef/resource/chef_client_scheduled_task.rb +++ b/lib/chef/resource/chef_client_scheduled_task.rb @@ -107,7 +107,7 @@ class Chef property :splay, [Integer, String], coerce: proc { |x| Integer(x) }, - callbacks: { "should be a positive number" => proc { |v| v > 0 } }, + callbacks: { "should be a positive number" => proc { |v| v >= 0 } }, description: "A random number of seconds between 0 and X to add to interval so that all #{ChefUtils::Dist::Infra::CLIENT} commands don't execute at the same time.", default: 300 diff --git a/lib/chef/run_context.rb b/lib/chef/run_context.rb index be7b787fcc..11bfc6e3c6 100644 --- a/lib/chef/run_context.rb +++ b/lib/chef/run_context.rb @@ -414,7 +414,7 @@ class Chef MissingCookbookDependency: Recipe `#{recipe_name}` is not in the run_list, and cookbook '#{cookbook_name}' is not a dependency of any cookbook in the run_list. To load this recipe, - first add a dependency of the cookbook '#{cookbook_name}' into the metadata + first add a dependency of the cookbook '#{cookbook_name}' into the metadata of the cookbook which depends on '#{cookbook_name}'. ERROR_MESSAGE end diff --git a/spec/unit/resource/chef_client_cron_spec.rb b/spec/unit/resource/chef_client_cron_spec.rb index b738a20a3a..cc72c38a39 100644 --- a/spec/unit/resource/chef_client_cron_spec.rb +++ b/spec/unit/resource/chef_client_cron_spec.rb @@ -43,6 +43,11 @@ describe Chef::Resource::ChefClientCron do expect { resource.splay("-10") }.to raise_error(Chef::Exceptions::ValidationFailed) end + it "set splay to 0" do + resource.splay "0" + expect(resource.splay).to eql(0) + end + it "builds a default value for chef_binary_path dist values" do expect(resource.chef_binary_path).to eql("/opt/chef/bin/chef-client") end diff --git a/spec/unit/resource/chef_client_launchd_spec.rb b/spec/unit/resource/chef_client_launchd_spec.rb index 1d0015cb0d..93d56a784e 100644 --- a/spec/unit/resource/chef_client_launchd_spec.rb +++ b/spec/unit/resource/chef_client_launchd_spec.rb @@ -43,6 +43,11 @@ describe Chef::Resource::ChefClientLaunchd do expect { resource.splay("-10") }.to raise_error(Chef::Exceptions::ValidationFailed) end + it "set splay to 0" do + resource.splay "0" + expect(resource.splay).to eql(0) + end + it "builds a default value for chef_binary_path dist values" do expect(resource.chef_binary_path).to eql("/opt/chef/bin/chef-client") end diff --git a/spec/unit/resource/chef_client_scheduled_task_spec.rb b/spec/unit/resource/chef_client_scheduled_task_spec.rb index bf165d4b70..45ed8c0602 100644 --- a/spec/unit/resource/chef_client_scheduled_task_spec.rb +++ b/spec/unit/resource/chef_client_scheduled_task_spec.rb @@ -43,6 +43,11 @@ describe Chef::Resource::ChefClientScheduledTask do expect { resource.splay("-10") }.to raise_error(Chef::Exceptions::ValidationFailed) end + it "set splay to 0" do + resource.splay "0" + expect(resource.splay).to eql(0) + end + it "coerces frequency_modifier to an Integer" do resource.frequency_modifier "10" expect(resource.frequency_modifier).to eql(10) diff --git a/spec/unit/resource/chef_client_systemd_timer_spec.rb b/spec/unit/resource/chef_client_systemd_timer_spec.rb index dfe01973fb..5fe4e80146 100644 --- a/spec/unit/resource/chef_client_systemd_timer_spec.rb +++ b/spec/unit/resource/chef_client_systemd_timer_spec.rb @@ -105,4 +105,4 @@ describe Chef::Resource::ChefClientSystemdTimer do expect(provider.service_content["Service"]["CPUQuota"]).to eq(50) end end -end
\ No newline at end of file +end |