From 9f3b604b1c205915474b31db58230d7712f96470 Mon Sep 17 00:00:00 2001 From: Joseph Chilcote Date: Sat, 25 Jan 2020 16:36:23 -0800 Subject: Account for if the propery is not being set in the resource, and also if it doesn't exist in the user record Signed-off-by: Joseph Chilcote --- lib/chef/provider/user/mac.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/chef/provider') diff --git a/lib/chef/provider/user/mac.rb b/lib/chef/provider/user/mac.rb index a8c97ef040..c570399ca3 100644 --- a/lib/chef/provider/user/mac.rb +++ b/lib/chef/provider/user/mac.rb @@ -51,7 +51,10 @@ class Chef current_resource.home(user_plist[:home][0]) current_resource.shell(user_plist[:shell][0]) current_resource.comment(user_plist[:comment][0]) - current_resource.hidden(user_plist[:is_hidden][0] == "1" ? true : false) + + if user_plist[:is_hidden] + current_resource.hidden(user_plist[:is_hidden][0] == "1" ? true : false) + end shadow_hash = user_plist[:shadow_hash] if shadow_hash -- cgit v1.2.1