Project

General

Profile

Actions

Bug #22676

closed

Fact importing with location set resets Domain even if domain isn't set or updated if domain isn't in the selected location

Added by Justin Sherrill about 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Category:
Network
Target version:
Fixed in Releases:
Found in Releases:

Description

Recently in katello we started noticing an issue where domain_id was being set to nil on interface during subscription-manager registration. To reproduce:

1. Have a host check in via puppet (domain is created with no org or location)
2. Register the same host with subscription-manager using an activation key.

sub-man register does a fact import using the Rhsm Fact Importer and Parser. This does NOT attempt to set a domain. Even though it doens't set the domain, it does provide other interface attributes which causes an update on the existing interfaces. Anytime an interface is updated this code gets called:

https://github.com/theforeman/foreman/blob/develop/app/models/nic/interface.rb#L108-L110

This line " if domain.nil? && name.include?('.') && changed_attributes['domain_id'].blank?" tries to detect if a domain is or is not set for the host. However since its calling 'domain.nil?' it requires that the current taxonomies be able to resolve the domain. Since location.current is set, and the domain is not in that location, domain always return nil.

Actions #1

Updated by The Foreman Bot about 6 years ago

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

Updated by Marek Hulán about 6 years ago

  • translation missing: en.field_release set to 330
Actions #3

Updated by Justin Sherrill about 6 years ago

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

Updated by Anonymous about 6 years ago

  • translation missing: en.field_release changed from 330 to 296
Actions #5

Updated by The Foreman Bot about 6 years ago

  • Pull request https://github.com/theforeman/foreman/pull/5303 added
Actions

Also available in: Atom PDF