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("Setting #{@new_resource} #{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("Managing the home directory for #{@new_resource}")
opts << " -d '#{@new_resource.home}'"
else
Chef::Log.debug("Setting #{@new_resource} 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