diff options
author | dheerajd-msys <dheeraj.dubey@msystechnologies.com> | 2020-07-29 17:39:27 +0530 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-08-17 21:42:55 -0700 |
commit | 473b4f93954260f5b532bfc5c3ea65363818d96b (patch) | |
tree | 87ca86f081d3de4f1ffceee04b9b082b5cc38263 | |
parent | 8ca992faa0ecd47dd02ad1f6578afec5ff3e0bc8 (diff) | |
download | chef-473b4f93954260f5b532bfc5c3ea65363818d96b.tar.gz |
install removed feature when source is available
Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>
-rw-r--r-- | lib/chef/resource/windows_feature_powershell.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/chef/resource/windows_feature_powershell.rb b/lib/chef/resource/windows_feature_powershell.rb index 5ec89835c8..f97c71c2a7 100644 --- a/lib/chef/resource/windows_feature_powershell.rb +++ b/lib/chef/resource/windows_feature_powershell.rb @@ -164,7 +164,11 @@ class Chef # @return [Array] features the user has requested to install which need installation def features_to_install # the intersection of the features to install & disabled/removed features are what needs installing - @install ||= new_resource.feature_name & ( node["powershell_features_cache"]["disabled"] | node["powershell_features_cache"]["removed"] ) + if new_resource.source && node["powershell_features_cache"]["removed"] + @install ||= new_resource.feature_name & ( node["powershell_features_cache"]["disabled"] | node["powershell_features_cache"]["removed"] ) + else + @install ||= new_resource.feature_name & node["powershell_features_cache"]["disabled"] + end end # @return [Array] features the user has requested to remove which need removing |