summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-05-04 15:25:07 -0700
committerTim Smith <tsmith84@gmail.com>2020-05-04 15:25:07 -0700
commit5be2f0293a657954720b557edb9a1525436a5e02 (patch)
treec46cf7c994004583b63a2306159929bab905c299
parent42e8fb3ac885547f931acb4a92dbc812c51de29c (diff)
downloadchef-required_fixes.tar.gz
Add apt_preference testsrequired_fixes
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/apt_preference.rb14
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/default.rb1
-rw-r--r--lib/chef/resource/sysctl.rb2
3 files changed, 16 insertions, 1 deletions
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/apt_preference.rb b/kitchen-tests/cookbooks/end_to_end/recipes/apt_preference.rb
new file mode 100644
index 0000000000..6b492230f1
--- /dev/null
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/apt_preference.rb
@@ -0,0 +1,14 @@
+#
+# Cookbook:: end_to_end
+# Recipe:: apt_preference
+#
+
+apt_preference "dotdeb" do
+ glob "*"
+ pin "origin packages.dotdeb.org"
+ pin_priority "700"
+end
+
+apt_preference "libmysqlclient16" do
+ action :remove
+end \ No newline at end of file
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/default.rb b/kitchen-tests/cookbooks/end_to_end/recipes/default.rb
index 6378d55bcc..a53ecf568f 100644
--- a/kitchen-tests/cookbooks/end_to_end/recipes/default.rb
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/default.rb
@@ -160,5 +160,6 @@ end
include_recipe "::_chef-vault" unless includes_recipe?("end_to_end::chef-vault")
include_recipe "::_sysctl"
+include_recipe "::_apt_preference"
include_recipe "::_alternatives"
include_recipe "::_tests"
diff --git a/lib/chef/resource/sysctl.rb b/lib/chef/resource/sysctl.rb
index 78d1072ddb..857688ee97 100644
--- a/lib/chef/resource/sysctl.rb
+++ b/lib/chef/resource/sysctl.rb
@@ -104,7 +104,7 @@ class Chef
property :value, [Array, String, Integer, Float],
description: "The value to set.",
coerce: proc { |v| coerce_value(v) },
- required: %i(:apply)
+ required: [:apply]
property :comment, [Array, String],
description: "Comments, placed above the resource setting in the generated file. For multi-line comments, use an array of strings, one per line.",