summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-03-29 17:57:28 -0700
committerTim Smith <tsmith@chef.io>2018-03-29 17:57:28 -0700
commitb9d35bfa2a43cebcedad4ce03564bc5581634e9f (patch)
treea1d46a8fb4ea56a21f8eff58cf15e0f3d359b287
parenta002b8925b302224751e82ece3b84bb28428a449 (diff)
downloadchef-b9d35bfa2a43cebcedad4ce03564bc5581634e9f.tar.gz
Minor syncs from the windows cookbook in windows_feature_dism
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/resource/windows_feature_dism.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/resource/windows_feature_dism.rb b/lib/chef/resource/windows_feature_dism.rb
index 2ba71a8186..df3bfeb5e2 100644
--- a/lib/chef/resource/windows_feature_dism.rb
+++ b/lib/chef/resource/windows_feature_dism.rb
@@ -94,7 +94,7 @@ class Chef
action :delete do
description "Remove a Windows role/feature from the image using DISM"
- fail_if_delete_unsupported
+ raise_if_delete_unsupported
reload_cached_dism_data unless node["dism_features_cache"]
@@ -208,7 +208,7 @@ class Chef
# @return [void]
def fail_if_removed
return if new_resource.source # if someone provides a source then all is well
- if node["os_version"].to_f > 6.2
+ if node["platform_version"].to_f > 6.2
return if registry_key_exists?('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Servicing') && registry_value_exists?('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Servicing', name: "LocalSourcePath") # if source is defined in the registry, still fine
end
removed = new_resource.feature_name & node["dism_features_cache"]["removed"]
@@ -217,7 +217,7 @@ class Chef
# Fail unless we're on windows 8+ / 2012+ where deleting a feature is supported
# @return [void]
- def fail_if_delete_unsupported
+ def raise_if_delete_unsupported
raise Chef::Exceptions::UnsupportedAction, "#{self} :delete action not support on Windows releases before Windows 8/2012. Cannot continue!" unless node["platform_version"].to_f >= 6.2
end
end