summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2014-09-04 22:28:26 -0700
committerJay Mundrawala <jdmundrawala@gmail.com>2014-09-04 22:28:26 -0700
commita316d71a24621efd5469e72663048d86ff324bb0 (patch)
tree89264d5eb0927e19a3f04e3dc7ea7752a8af662a
parente54533b1fd79a196bae8a812a1e88b2ededec300 (diff)
downloadchef-jdmundrawala/dsc-provider-platform-mapping.tar.gz
Platform mapping for dsc_scriptjdmundrawala/dsc-provider-platform-mapping
-rw-r--r--lib/chef/platform/provider_mapping.rb9
-rw-r--r--lib/chef/resource/dsc_script.rb5
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/chef/platform/provider_mapping.rb b/lib/chef/platform/provider_mapping.rb
index d61298e182..8705122a9c 100644
--- a/lib/chef/platform/provider_mapping.rb
+++ b/lib/chef/platform/provider_mapping.rb
@@ -277,7 +277,8 @@ class Chef
:group => Chef::Provider::Group::Windows,
:mount => Chef::Provider::Mount::Windows,
:batch => Chef::Provider::Batch,
- :powershell_script => Chef::Provider::PowershellScript
+ :powershell_script => Chef::Provider::PowershellScript,
+ :dsc_script => Chef::Provider::DscScript
}
},
:mingw32 => {
@@ -288,7 +289,8 @@ class Chef
:group => Chef::Provider::Group::Windows,
:mount => Chef::Provider::Mount::Windows,
:batch => Chef::Provider::Batch,
- :powershell_script => Chef::Provider::PowershellScript
+ :powershell_script => Chef::Provider::PowershellScript,
+ :dsc_script => Chef::Provider::DscScript
}
},
:windows => {
@@ -299,7 +301,8 @@ class Chef
:group => Chef::Provider::Group::Windows,
:mount => Chef::Provider::Mount::Windows,
:batch => Chef::Provider::Batch,
- :powershell_script => Chef::Provider::PowershellScript
+ :powershell_script => Chef::Provider::PowershellScript,
+ :dsc_script => Chef::Provider::DscScript
}
},
:solaris => {},
diff --git a/lib/chef/resource/dsc_script.rb b/lib/chef/resource/dsc_script.rb
index 2972ace1aa..2c836f0d8a 100644
--- a/lib/chef/resource/dsc_script.rb
+++ b/lib/chef/resource/dsc_script.rb
@@ -26,11 +26,10 @@ class Chef
def initialize(name, run_context=nil)
super
+ @resource_name = :dsc_script
@allowed_actions.push(:run)
@action = :run
- if(run_context && Chef::Platform.supports_dsc?(run_context.node))
- @provider = Chef::Provider::DscScript
- else
+ if(!run_context || !Chef::Platform.supports_dsc?(run_context.node))
raise Chef::Exceptions::NoProviderAvailable,
"#{powershell_info_str(run_context)}\nPowershell 4.0 or higher was not detected on your system and is required to use the dsc_script resource."
end