diff options
author | Claire McQuin <claire@getchef.com> | 2015-09-08 12:20:45 -0700 |
---|---|---|
committer | Claire McQuin <claire@getchef.com> | 2015-09-08 13:24:25 -0700 |
commit | 998e13adbda5e964d2f8d17ebd8f216f752244a6 (patch) | |
tree | 6bd0c042229dca9865bc37a81a87bc1c7bf23d83 /lib/chef/provider/dsc_resource.rb | |
parent | 530119278f6a71eef4b0bf02df022218a96dcecc (diff) | |
download | chef-998e13adbda5e964d2f8d17ebd8f216f752244a6.tar.gz |
Skip tests unless RefreshMode is Disabled
Diffstat (limited to 'lib/chef/provider/dsc_resource.rb')
-rw-r--r-- | lib/chef/provider/dsc_resource.rb | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/chef/provider/dsc_resource.rb b/lib/chef/provider/dsc_resource.rb index 379369ba6e..31c6c078f4 100644 --- a/lib/chef/provider/dsc_resource.rb +++ b/lib/chef/provider/dsc_resource.rb @@ -59,9 +59,7 @@ class Chef a.block_action! end requirements.assert(:run) do |a| - a.assertion { - meta_configuration['RefreshMode'] == 'Disabled' - } + a.assertion { refresh_mode_disabled? } err = ["The LCM must have its RefreshMode set to Disabled. "] a.failure_message Chef::Exceptions::ProviderNotFound, err.join(' ') a.whyrun err + ["Assuming a previous resource sets the RefreshMode."] @@ -85,6 +83,10 @@ class Chef def supports_dsc_invoke_resource? run_context && Chef::Platform.supports_dsc_invoke_resource?(node) end + + def refresh_mode_disabled? + Chef::Platform.refresh_mode_disabled?(node) + end def generate_description @converge_description @@ -153,12 +155,6 @@ class Chef cmdlet.run! end - def meta_configuration - cmdlet = Chef::Util::Powershell::Cmdlet.new(node, "Get-DscLocalConfigurationManager", :object) - result = cmdlet.run! - result.return_value - end - end end end |