diff options
author | Tim Smith <tsmith@chef.io> | 2017-09-14 18:08:23 -0700 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2017-09-14 18:50:53 -0700 |
commit | 114c7786670c180c15cfc152432a7df1c0b1fc52 (patch) | |
tree | d7aab36d8c3cd081813c80dc4f476951d4692336 /lib/chef/resource | |
parent | fe65320e7d009cd8822b9060ff910c57766693ec (diff) | |
download | chef-114c7786670c180c15cfc152432a7df1c0b1fc52.tar.gz |
Replace which apt-get check with simple debian check in apt resources
apt-get is a link to yast2 in suse so these resources fire there when someone wouldn't expect them to. Looking back we probably should have skipped the whole platform based no-op thing, but that ship sailed. This makes it behave the way a user would expect it to. What happens if you have apt compiled on your gentoo box? Well it's going to break. We'll just have to live with fixing it for 99.99% of users instead of the current 95%. Also: This is faster.
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/resource')
-rw-r--r-- | lib/chef/resource/apt_preference.rb | 2 | ||||
-rw-r--r-- | lib/chef/resource/apt_repository.rb | 4 | ||||
-rw-r--r-- | lib/chef/resource/apt_update.rb | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/chef/resource/apt_preference.rb b/lib/chef/resource/apt_preference.rb index 603766d76b..b610f538a6 100644 --- a/lib/chef/resource/apt_preference.rb +++ b/lib/chef/resource/apt_preference.rb @@ -22,7 +22,7 @@ class Chef class Resource class AptPreference < Chef::Resource resource_name :apt_preference - provides :apt_preference + provides :apt_preference, os: "linux", platform_family: [ "debian" ] property :package_name, String, name_property: true, regex: [/^([a-z]|[A-Z]|[0-9]|_|-|\.|\*|\+)+$/] property :glob, String diff --git a/lib/chef/resource/apt_repository.rb b/lib/chef/resource/apt_repository.rb index 3a2d30be2c..0b2388d96b 100644 --- a/lib/chef/resource/apt_repository.rb +++ b/lib/chef/resource/apt_repository.rb @@ -1,6 +1,6 @@ # # Author:: Thom May (<thom@chef.io>) -# Copyright:: Copyright (c) 2016 Chef Software, Inc. +# Copyright:: 2016-2017, Chef Software, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,7 +22,7 @@ class Chef class Resource class AptRepository < Chef::Resource resource_name :apt_repository - provides :apt_repository + provides :apt_repository, os: "linux", platform_family: [ "debian" ] property :repo_name, String, name_property: true property :uri, String diff --git a/lib/chef/resource/apt_update.rb b/lib/chef/resource/apt_update.rb index 67ca7fbfea..b985957529 100644 --- a/lib/chef/resource/apt_update.rb +++ b/lib/chef/resource/apt_update.rb @@ -22,7 +22,7 @@ class Chef class Resource class AptUpdate < Chef::Resource resource_name :apt_update - provides :apt_update + provides :apt_update, os: "linux", platform_family: [ "debian" ] # allow bare apt_update with no name property :name, String, default: "" |