summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordheerajd-msys <dheeraj.dubey@msystechnologies.com>2020-07-29 17:39:27 +0530
committerdheerajd-msys <dheeraj.dubey@msystechnologies.com>2020-07-29 17:39:27 +0530
commita9b059341703147c904f38abe65a867d5716bf56 (patch)
tree317b9dc994250cb160043f5cddce5c0624c1642b
parent4cde899df21bbf880068688f43fc5abd2d1bc69f (diff)
downloadchef-a9b059341703147c904f38abe65a867d5716bf56.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.rb6
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