diff options
author | Davin Taddeo <davin@chef.io> | 2020-06-25 23:18:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-25 23:18:13 -0400 |
commit | 14259a2cee18920e243b3082a78ed0d034fb658e (patch) | |
tree | 61431a93ca21c5e734968121c69b8461c42deaac /lib/chef | |
parent | a24f5cbfa094bcdde128575bfa9c836ca1a52799 (diff) | |
download | chef-14259a2cee18920e243b3082a78ed0d034fb658e.tar.gz |
Update lib/chef/resource/windows_security_policy.rb
Co-authored-by: pete higgins <pete@peterhiggins.org>
Diffstat (limited to 'lib/chef')
-rw-r--r-- | lib/chef/resource/windows_security_policy.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/chef/resource/windows_security_policy.rb b/lib/chef/resource/windows_security_policy.rb index 13db56a0c6..84a481d2d9 100644 --- a/lib/chef/resource/windows_security_policy.rb +++ b/lib/chef/resource/windows_security_policy.rb @@ -82,12 +82,10 @@ class Chef load_current_value do |desired| secopt_values = load_secopts_state - output = powershell_out(secopt_values) - if output.stdout.empty? - current_value_does_not_exist! - else - state = Chef::JSONCompat.from_json(output.stdout) - end + output = powershell_out(secopt_values).stdout.strip + current_value_does_not_exist! if output.empty? + + state = Chef::JSONCompat.from_json(output) secvalue state[desired.secoption.to_s] end |