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 10:15:09 -0800
commit5ecb31a64c1feb5f537423434abce9ad75880502 (patch)
tree6b26b39454d5ea32b42ed4eedee796a5e41c8f53
parentb9198d055347a99502d1239b506b4cb8852645c2 (diff)
downloadchef-5ecb31a64c1feb5f537423434abce9ad75880502.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