Project

General

Profile

« Previous | Next » 

Revision 308f611d

Added by Marek Hulán about 8 years ago

Fixes #14264 - improve primary interface selection

View differences:

app/controllers/api/v2/hosts_controller.rb
params[:interfaces_attributes] = params[:interfaces_attributes].map do |nic_attr|
interface_attributes(nic_attr)
end
#if no primary interface set explicitly, set first one as primary
unless params[:interfaces_attributes].any?{|i| i[:primary]}
params[:interfaces_attributes].first[:primary] = true
end
end
params = host.apply_inherited_attributes(params) if host
params

Also available in: Unified diff