Project

General

Profile

Bug #12478

Virtual interfaces with :attached_to defined can't be updated by Host::Base.populate_fields_from_facts

Added by Brandon Weeks almost 4 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Network
Target version:
Difficulty:
trivial
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

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. :)

Associated revisions

Revision a05b0df0 (diff)
Added by Brandon Weeks almost 4 years ago

Fixes #12478 - don't update :attached_to if parsed :attached_to is nil

Revision 928ed680 (diff)
Added by Brandon Weeks over 3 years ago

Fixes #12478 - don't update :attached_to if parsed :attached_to is nil

(cherry picked from commit a05b0df0462711436b8b4754d717e90a07cd5f4d)

History

#1 Updated by The Foreman Bot almost 4 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2912 added

#2 Updated by Dominic Cleal almost 4 years ago

  • Legacy Backlogs Release (now unused) deleted (63)

#3 Updated by The Foreman Bot almost 4 years ago

  • Assignee set to Brandon Weeks

#4 Updated by Brandon Weeks almost 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#5 Updated by Dominic Cleal almost 4 years ago

  • % Done changed from 100 to 0
  • Legacy Backlogs Release (now unused) set to 104

#6 Updated by Marek Hulán almost 4 years ago

FWIW, attached_to is not meant to be set by puppet (or other cfg mgmt tool) but it's constructed from virtual names (e.g. eth0.1 -> eth0), see https://github.com/brandonweeks/foreman/blob/56671b5f0cfa6dd185cb75d40445300e3b6668f5/app/services/fact_parser.rb#L126 for more details. Anyway, thanks for the patch.

#7 Updated by Brandon Weeks almost 4 years ago

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?

#8 Updated by Marek Hulán almost 4 years ago

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