Actions
Bug #16061
closedautomatical ip assignment not working for non-primary interfaces
Description
Hi,
when creating a server over the api the automatical ip assignment only works for the primary interface, the other configured interfaces are being created but no ip is set.
The call from production.log:
Parameters: {"host"=>{"name"=>"server1.example.com", "location_id"=>"3", "organization_id"=>"1", "compute_resource_id"=>"2", "compute_profile_id"=>"2", "hostgroup_id"=>"6", "interfaces_attributes"=>[{"identifier"=>"eth0", "name"=>"server1", "subnet_id"=>7, "domain_id"=>2, "managed"=>true, "provision"=>true, "primary"=>true}, {"identifier"=>"eth1", "name"=>"server1i1", "subnet_id"=>4, "domain_id"=>2, "managed"=>true, "provision"=>false, "primary"=>false}, {"identifier"=>"eth2", "name"=>"server1i2", "subnet_id"=>6, "domain_id"=>2, "managed"=>true, "provision"=>false, "primary"=>false}, {"identifier"=>"eth3", "name"=>"server1i3", "subnet_id"=>5, "domain_id"=>2, "managed"=>true, "provision"=>false, "primary"=>false}], "host_parameters_attributes"=>[{"name"=>"E-Mail", "value"=>"[FILTERED]"}], "build"=>true}, "apiv"=>"v2"}
I think the set_ip_address function needs to iterate over all interfaces that are set to managed
https://github.com/theforeman/foreman/blob/develop/app/models/host/managed.rb#L630-L635
Greetings
Klaas
Updated by The Foreman Bot over 8 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/3735 added
Updated by Anonymous over 8 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset a86dcf44b236e59c1b4370c1a51749360420e69e.
Updated by Dominic Cleal over 8 years ago
- Assignee set to Klaas D
- Translation missing: en.field_release set to 175
Actions