diff options
author | dheerajd-msys <dheeraj.dubey@msystechnologies.com> | 2020-07-29 17:39:27 +0530 |
---|---|---|
committer | dheerajd-msys <dheeraj.dubey@msystechnologies.com> | 2020-07-29 17:39:27 +0530 |
commit | a9b059341703147c904f38abe65a867d5716bf56 (patch) | |
tree | 317b9dc994250cb160043f5cddce5c0624c1642b /lib/chef | |
parent | 4cde899df21bbf880068688f43fc5abd2d1bc69f (diff) | |
download | chef-a9b059341703147c904f38abe65a867d5716bf56.tar.gz |
install removed feature when source is available
Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>
Diffstat (limited to 'lib/chef')
-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 829f07317b..048c67229c 100644 --- a/lib/chef/resource/windows_feature_powershell.rb +++ b/lib/chef/resource/windows_feature_powershell.rb @@ -142,7 +142,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 |