diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2015-02-23 19:14:56 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2015-03-04 13:52:44 -0800 |
commit | c3552dc11831379a4b4753964451498e1340611e (patch) | |
tree | eb7aba75e15ca4ddd51afb61d8b850fb9d25edc3 /lib/chef/provider | |
parent | 0bb2861228fd33fd6a4ef296a1dd223abb6dec9f (diff) | |
download | chef-c3552dc11831379a4b4753964451498e1340611e.tar.gz |
provider_resolver migration from provider_mapping
- move macosx providers to dynamic resolution
- move windows providers to dynamic resolution
- move openbsd/netbsd providers to dynamic resolution
- move all cron providers to dynamic resolution
- move mdadm to static mapping
Diffstat (limited to 'lib/chef/provider')
-rw-r--r-- | lib/chef/provider/batch.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/cron.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/cron/aix.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/env.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/env/windows.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/group/dscl.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/group/groupmod.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/group/usermod.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/group/windows.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/mdadm.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/mount/windows.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/package/homebrew.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/powershell_script.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/user/dscl.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/user/windows.rb | 2 |
15 files changed, 29 insertions, 1 deletions
diff --git a/lib/chef/provider/batch.rb b/lib/chef/provider/batch.rb index 354a640e59..b6b386e5a8 100644 --- a/lib/chef/provider/batch.rb +++ b/lib/chef/provider/batch.rb @@ -22,6 +22,8 @@ class Chef class Provider class Batch < Chef::Provider::WindowsScript + provides :batch, os: "windows" + def initialize (new_resource, run_context) super(new_resource, run_context, '.bat') end diff --git a/lib/chef/provider/cron.rb b/lib/chef/provider/cron.rb index 1590c624f6..4b7836947e 100644 --- a/lib/chef/provider/cron.rb +++ b/lib/chef/provider/cron.rb @@ -25,6 +25,8 @@ class Chef class Cron < Chef::Provider include Chef::Mixin::Command + provides :cron, os: "!aix" + SPECIAL_TIME_VALUES = [:reboot, :yearly, :annually, :monthly, :weekly, :daily, :midnight, :hourly] CRON_ATTRIBUTES = [:minute, :hour, :day, :month, :weekday, :time, :command, :mailto, :path, :shell, :home, :environment] WEEKDAY_SYMBOLS = [:sunday, :monday, :tuesday, :wednesday, :thursday, :friday, :saturday] diff --git a/lib/chef/provider/cron/aix.rb b/lib/chef/provider/cron/aix.rb index 473700bf2f..9cacbc6ec9 100644 --- a/lib/chef/provider/cron/aix.rb +++ b/lib/chef/provider/cron/aix.rb @@ -23,6 +23,8 @@ class Chef class Cron class Aix < Chef::Provider::Cron::Unix + provides :cron, os: "aix" + private # For AIX we ignore env vars/[ :mailto, :path, :shell, :home ] diff --git a/lib/chef/provider/env.rb b/lib/chef/provider/env.rb index 815a19bc0c..cf75ff7d85 100644 --- a/lib/chef/provider/env.rb +++ b/lib/chef/provider/env.rb @@ -26,6 +26,8 @@ class Chef include Chef::Mixin::Command attr_accessor :key_exists + provides :env, os: "!windows" + def initialize(new_resource, run_context) super @key_exists = true diff --git a/lib/chef/provider/env/windows.rb b/lib/chef/provider/env/windows.rb index dd7cb1bc46..56cebdb888 100644 --- a/lib/chef/provider/env/windows.rb +++ b/lib/chef/provider/env/windows.rb @@ -24,6 +24,8 @@ class Chef class Windows < Chef::Provider::Env include Chef::Mixin::WindowsEnvHelper + provides :env, os: "windows" + def create_env obj = env_obj(@new_resource.key_name) unless obj diff --git a/lib/chef/provider/group/dscl.rb b/lib/chef/provider/group/dscl.rb index a59a94aa98..d7e8f2e827 100644 --- a/lib/chef/provider/group/dscl.rb +++ b/lib/chef/provider/group/dscl.rb @@ -21,6 +21,8 @@ class Chef class Group class Dscl < Chef::Provider::Group + provides :group, os: "darwin" + def dscl(*args) host = "." stdout_result = ""; stderr_result = ""; cmd = "dscl #{host} -#{args.join(' ')}" diff --git a/lib/chef/provider/group/groupmod.rb b/lib/chef/provider/group/groupmod.rb index 7ad762af8d..f9299546c8 100644 --- a/lib/chef/provider/group/groupmod.rb +++ b/lib/chef/provider/group/groupmod.rb @@ -21,6 +21,8 @@ class Chef class Group class Groupmod < Chef::Provider::Group + provides :group, os: "netbsd" + def load_current_resource super [ "group", "user" ].each do |binary| diff --git a/lib/chef/provider/group/usermod.rb b/lib/chef/provider/group/usermod.rb index e9dcc38b43..e50e13c443 100644 --- a/lib/chef/provider/group/usermod.rb +++ b/lib/chef/provider/group/usermod.rb @@ -23,6 +23,8 @@ class Chef class Group class Usermod < Chef::Provider::Group::Groupadd + provides :group, os: "openbsd" + def load_current_resource super end diff --git a/lib/chef/provider/group/windows.rb b/lib/chef/provider/group/windows.rb index c9c3da29e0..54e49b0e06 100644 --- a/lib/chef/provider/group/windows.rb +++ b/lib/chef/provider/group/windows.rb @@ -26,6 +26,8 @@ class Chef class Group class Windows < Chef::Provider::Group + provides :group, os: "windows" + def initialize(new_resource,run_context) super @net_group = Chef::Util::Windows::NetGroup.new(@new_resource.group_name) diff --git a/lib/chef/provider/mdadm.rb b/lib/chef/provider/mdadm.rb index d156e49d48..325f1b5977 100644 --- a/lib/chef/provider/mdadm.rb +++ b/lib/chef/provider/mdadm.rb @@ -23,6 +23,8 @@ class Chef class Provider class Mdadm < Chef::Provider + provides :mdadm + def popen4 raise Exception, "deprecated" end diff --git a/lib/chef/provider/mount/windows.rb b/lib/chef/provider/mount/windows.rb index 02aa78919a..87873474b3 100644 --- a/lib/chef/provider/mount/windows.rb +++ b/lib/chef/provider/mount/windows.rb @@ -27,6 +27,8 @@ class Chef class Mount class Windows < Chef::Provider::Mount + provides :mount, os: "windows" + def is_volume(name) name =~ /^\\\\\?\\Volume\{[\w-]+\}\\$/ ? true : false end diff --git a/lib/chef/provider/package/homebrew.rb b/lib/chef/provider/package/homebrew.rb index e043c01f56..603899646f 100644 --- a/lib/chef/provider/package/homebrew.rb +++ b/lib/chef/provider/package/homebrew.rb @@ -27,7 +27,7 @@ class Chef class Homebrew < Chef::Provider::Package provides :homebrew_package - provides :package, os: ["mac_os_x", "darwin"] + provides :package, os: "darwin" include Chef::Mixin::HomebrewUser diff --git a/lib/chef/provider/powershell_script.rb b/lib/chef/provider/powershell_script.rb index 8c79b384e9..f9dcd6d80c 100644 --- a/lib/chef/provider/powershell_script.rb +++ b/lib/chef/provider/powershell_script.rb @@ -22,6 +22,8 @@ class Chef class Provider class PowershellScript < Chef::Provider::WindowsScript + provides :powershell_script, os: "windows" + protected EXIT_STATUS_EXCEPTION_HANDLER = "\ntrap [Exception] {write-error -exception ($_.Exception.Message);exit 1}".freeze EXIT_STATUS_NORMALIZATION_SCRIPT = "\nif ($? -ne $true) { if ( $LASTEXITCODE ) {exit $LASTEXITCODE} else { exit 1 }}".freeze diff --git a/lib/chef/provider/user/dscl.rb b/lib/chef/provider/user/dscl.rb index debf36f771..0726b08ded 100644 --- a/lib/chef/provider/user/dscl.rb +++ b/lib/chef/provider/user/dscl.rb @@ -44,6 +44,8 @@ class Chef # This provider only supports Mac OSX versions 10.7 and above class Dscl < Chef::Provider::User + provides :user, os: "darwin" + def define_resource_requirements super diff --git a/lib/chef/provider/user/windows.rb b/lib/chef/provider/user/windows.rb index 66ef30c349..e282a11d45 100644 --- a/lib/chef/provider/user/windows.rb +++ b/lib/chef/provider/user/windows.rb @@ -27,6 +27,8 @@ class Chef class User class Windows < Chef::Provider::User + provides :user, os: "windows" + def initialize(new_resource,run_context) super @net_user = Chef::Util::Windows::NetUser.new(@new_resource.username) |