summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-11-07 09:21:36 -0800
committerTim Smith <tsmith@chef.io>2018-11-07 09:47:58 -0800
commit094e5a12d692220043db6cc5e5760050e601bede (patch)
tree719844689c1e86ccc14763a77ef7b4fd5d753301
parent7b5393389fddedb234b62e1d5c3498400bc95fcf (diff)
downloadchef-094e5a12d692220043db6cc5e5760050e601bede.tar.gz
More tweaks to when we quote defaults in resource-inspector
We were quoting a lot of odd things like empty arrays or empty strings. The original intent was to quote symbols. Let's just stick to that. Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/resource/windows_feature.rb2
-rw-r--r--lib/chef/resource_inspector.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/resource/windows_feature.rb b/lib/chef/resource/windows_feature.rb
index 9809f01a5e..1ae13a9a2f 100644
--- a/lib/chef/resource/windows_feature.rb
+++ b/lib/chef/resource/windows_feature.rb
@@ -43,8 +43,8 @@ class Chef
default: false
property :install_method, Symbol,
- equal_to: [:windows_feature_dism, :windows_feature_powershell, :windows_feature_servermanagercmd]
description: "The underlying installation method to use for feature installation. Specify ':windows_feature_dism' for DISM or ':windows_feature_powershell' for PowerShell.",
+ equal_to: [:windows_feature_dism, :windows_feature_powershell, :windows_feature_servermanagercmd]
property :timeout, Integer,
description: "Specifies a timeout (in seconds) for the feature installation.",
diff --git a/lib/chef/resource_inspector.rb b/lib/chef/resource_inspector.rb
index 55a4d8e65d..ac65e55e99 100644
--- a/lib/chef/resource_inspector.rb
+++ b/lib/chef/resource_inspector.rb
@@ -31,7 +31,7 @@ module ResourceInspector
# code for the resource ourselves and just no
"lazy default"
else
- default.inspect unless default.nil? # inspect properly returns symbols
+ default.is_a?(Symbol) ? default.inspect : default # inspect properly returns symbols
end
end