def universal_options
opts = ''
UNIVERSAL_OPTIONS.each do |field, option|
if @current_resource.send(field) != @new_resource.send(field)
if @new_resource.send(field)
Chef::Log.debug("#{@new_resource} setting #{field} to #{@new_resource.send(field)}")
opts << " #{option} '#{@new_resource.send(field)}'"
end
end
end
if updating_home?
if managing_home_dir?
Chef::Log.debug("#{@new_resource} managing the users home directory")
opts << " -m -d '#{@new_resource.home}'"
else
Chef::Log.debug("#{@new_resource} setting home to #{@new_resource.home}")
opts << " -d '#{@new_resource.home}'"
end
end
opts << " -o" if @new_resource.non_unique || @new_resource.supports[:non_unique]
opts
end