Revision 45831c5a
Added by Marek Hulán about 8 years ago
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
Fixes #14264 - improve primary interface selection
(cherry picked from commit 308f611d9bb17173588a6f59c7a914b551923a7b)