summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-06-10 09:31:09 -0700
committerTim Smith <tsmith@chef.io>2018-06-10 09:31:09 -0700
commitfd59cdaca0489c5ee645c0f0833edd73945b1886 (patch)
treefc95757d7ac25046c64ea46c3b4cd1059f647df9
parent0d41d83a2d6fe29118669cf707962dcb31a58bb7 (diff)
downloadchef-fd59cdaca0489c5ee645c0f0833edd73945b1886.tar.gz
Fix error messages and helper usage
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/resource/windows_feature_dism.rb4
-rw-r--r--lib/chef/resource/windows_feature_powershell.rb2
2 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 349e97036b..fc6f25fb3f 100644
--- a/lib/chef/resource/windows_feature_dism.rb
+++ b/lib/chef/resource/windows_feature_dism.rb
@@ -201,7 +201,7 @@ class Chef
# dism on windows 2012+ isn't case sensitive so it's best to compare
# lowercase lists so the user input doesn't need to be case sensitive
# @todo when we're ready to remove windows 2008R2 the gating here can go away
- feature_details.downcase! unless Chef::Platform.older_than_win_2012_or_8
+ feature_details.downcase! unless Chef::Platform.older_than_win_2012_or_8?
node.override["dism_features_cache"][feature_type] << feature_details
end
@@ -219,7 +219,7 @@ class Chef
# Fail unless we're on windows 8+ / 2012+ where deleting a feature is supported
# @return [void]
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
+ raise Chef::Exceptions::UnsupportedAction, "#{self} :delete action not supported on Windows releases before Windows 8/2012. Cannot continue!" if Chef::Platform.older_than_win_2012_or_8?
end
end
end
diff --git a/lib/chef/resource/windows_feature_powershell.rb b/lib/chef/resource/windows_feature_powershell.rb
index dfe1b87a9f..daee0e9d34 100644
--- a/lib/chef/resource/windows_feature_powershell.rb
+++ b/lib/chef/resource/windows_feature_powershell.rb
@@ -259,7 +259,7 @@ class Chef
# Fail unless we're on windows 8+ / 2012+ where deleting a feature is supported
def raise_if_delete_unsupported
- raise Chef::Exceptions::UnsupportedAction, "#{self} :delete action not support on Windows releases before Windows 8/2012. Cannot continue!" if Chef::Platform.older_than_win_2012_or_8
+ raise Chef::Exceptions::UnsupportedAction, "#{self} :delete action not supported on Windows releases before Windows 8/2012. Cannot continue!" if Chef::Platform.older_than_win_2012_or_8?
end
end
end