lib/chef/scan_access_control.rb in chef-10.14.0.beta.3 vs lib/chef/scan_access_control.rb in chef-10.14.0.rc.0

- old
+ new

@@ -63,13 +63,11 @@ @current_resource.owner(current_owner) end def current_owner case new_resource.owner - when nil - nil - when String + when String, nil lookup_uid when Integer stat.uid else Chef::Log.error("The `owner` parameter of the #@new_resource resource is set to an invalid value (#{new_resource.owner.inspect})") @@ -88,13 +86,11 @@ @current_resource.group(current_group) end def current_group case new_resource.group - when nil - nil - when String + when String, nil lookup_gid when Integer stat.gid else Chef::Log.error("The `group` parameter of the #@new_resource resource is set to an invalid value (#{new_resource.owner.inspect})") @@ -112,12 +108,10 @@ @current_resource.mode(current_mode) end def current_mode case new_resource.mode - when nil - nil - when String + when String, nil (stat.mode & 007777).to_s(8) when Integer stat.mode & 007777 else Chef::Log.error("The `mode` parameter of the #@new_resource resource is set to an invalid value (#{new_resource.mode.inspect})")