summaryrefslogtreecommitdiff
path: root/lib/chef/provider
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2017-04-02 10:26:54 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2017-04-02 10:26:54 -0700
commitbef110cb38d25308d8334557bfe12dcdeace66b8 (patch)
treefbf593e4b4c47310dd48484c035b0bb5b370ae8f /lib/chef/provider
parent3945739ebb631226101a9754fbc6d0479063a8b9 (diff)
downloadchef-bef110cb38d25308d8334557bfe12dcdeace66b8.tar.gz
Chef-13: turn on zypper gpg checks by defaultlcg/zypper-gpg
Adds a gpg_check property to the resource to turn them off on a per-resource basis. The global config is also preserved. The global config will warn once if you have it set to turn off gpg checks. The per-resource property will not warn (presumably you know you're doing something bad when you turn it off). Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/provider')
-rw-r--r--lib/chef/provider/package/zypper.rb14
1 files changed, 2 insertions, 12 deletions
diff --git a/lib/chef/provider/package/zypper.rb b/lib/chef/provider/package/zypper.rb
index 45c6c91f60..7b8fd6c426 100644
--- a/lib/chef/provider/package/zypper.rb
+++ b/lib/chef/provider/package/zypper.rb
@@ -2,7 +2,7 @@
#
# Authors:: Adam Jacob (<adam@chef.io>)
# Ionuț Arțăriși (<iartarisi@suse.cz>)
-# Copyright:: Copyright 2008-2016, Chef Software, Inc.
+# Copyright:: Copyright 2008-2017, Chef Software Inc.
# Copyright 2013-2016, SUSE Linux GmbH
# License:: Apache License, Version 2.0
#
@@ -145,17 +145,7 @@ class Chef
end
def gpg_checks
- case Chef::Config[:zypper_check_gpg]
- when true
- nil
- when false
- "--no-gpg-checks"
- when nil
- Chef::Log.warn("Chef::Config[:zypper_check_gpg] was not set. " \
- "All packages will be installed without gpg signature checks. " \
- "This is a security hazard.")
- "--no-gpg-checks"
- end
+ "--no-gpg-checks" unless new_resource.gpg_check
end
end
end