Bug #12478
closed
Virtual interfaces with :attached_to defined can't be updated by Host::Base.populate_fields_from_facts
Added by Brandon Weeks almost 9 years ago.
Updated over 6 years ago.
Description
When a virtual interfaces has a value for :attached_to, it fails to get updated when Host::Base.populate_fields_from_facts runs. This is because (at least in Puppet environments) the facts table does not contain a value for :attached_to.
The resulting error:
2015-11-13 17:19:14 [sql] [W] Saving bond0 NIC for host host.example.com failed, skipping because:
2015-11-13 17:19:14 [sql] [W] Attached to can't be blank
PR incoming. :)
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/2912 added
- Translation missing: en.field_release deleted (
63)
- Assignee set to Brandon Weeks
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
- % Done changed from 100 to 0
- Translation missing: en.field_release set to 104
Thanks for the context! Knowing that it's obvious that the problem we were running into is our our virtual interface is named "bond0," do you think there any other improvements that should be made for handling virtual interfaces that don't have the suffix pattern?
I think your patch fixed it for all interfaces, if I understood it correctly it makes attached_to nil instead of empty string. The other way to fix it would be to just fix the validation to accept empty strings in this attribute for bonds and bridges but this seems to work just fine :-)
Also available in: Atom
PDF