summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasu1105 <vasundhara.jagdale@msystechnologies.com>2020-02-24 22:52:12 -0800
committerVasu1105 <vasundhara.jagdale@msystechnologies.com>2020-02-24 22:52:12 -0800
commitdf4c45c05ed14ddfefeeab2726e2f756723d1d08 (patch)
tree8326fc5cd40d5624af164d78149296491fb53d28
parentb55fa03435b8045a3cea58693691cd0c12d1a3db (diff)
downloadchef-df4c45c05ed14ddfefeeab2726e2f756723d1d08.tar.gz
Removed sensitive property, and updated debug message for remove action
Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
-rw-r--r--lib/chef/resource/windows_user_privilege.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/chef/resource/windows_user_privilege.rb b/lib/chef/resource/windows_user_privilege.rb
index 1a162457ec..338fa5f680 100644
--- a/lib/chef/resource/windows_user_privilege.rb
+++ b/lib/chef/resource/windows_user_privilege.rb
@@ -88,8 +88,6 @@ class Chef
},
}
- property :sensitive, [TrueClass, FalseClass], default: true
-
load_current_value do |new_resource|
unless new_resource.principal.nil?
privilege Chef::ReservedNames::Win32::Security.get_account_right(new_resource.principal) unless new_resource.action.include?(:set)
@@ -139,13 +137,11 @@ class Chef
action :remove do
curr_res_privilege = current_resource.privilege
- new_res_privilege = new_resource.privilege
-
- new_res_privilege = [] << new_res_privilege if new_resource.privilege.is_a?(String)
+ new_res_privilege = new_resource.privilege.is_a?(String) ? Array(new_resource.privilege) : new_resource.privilege
missing_res_privileges = (new_res_privilege - curr_res_privilege)
- unless missing_res_privileges.empty?
- Chef::Log.info("Privilege: #{missing_res_privileges.join(", ")} not present. Unable to delete")
+ if missing_res_privileges
+ Chef::Log.info("User \'#{new_resource.principal}\' for Privilege: #{missing_res_privileges.join(", ")} not found. Nothing to remove.")
end
(new_res_privilege - missing_res_privileges).each do |user_right|