Bug #6358

Renaming host orphans lookup_values

Added by Trey Dockendorf over 3 years ago. Updated about 3 years ago.

Status:Closed
Priority:Normal
Assigned To:Trey Dockendorf
Category:Smart Variables
Target version:Sprint 25
Difficulty: Bugzilla link:1117834
Found in release:1.5.0 Pull request:
Story points-
Velocity based estimate-
Release1.5.2Release relationshipAuto

Description

Using Foreman 1.5.0 I renamed the host 'myproxy.DOMAIN' to 'globus-id.DOMAIN' which was successful. However the class parameters that were overridden no longer are associated to that host. An attempt to name the host back to its original name fails.

ActiveRecord::RecordInvalid
Validation failed: Match fqdn=myproxy.DOMAIN does not match an existing host
app/models/concerns/host_common.rb:46:in `block in lookup_values_attributes='
app/models/concerns/host_common.rb:39:in `each_value'
app/models/concerns/host_common.rb:39:in `lookup_values_attributes='
app/controllers/hosts_controller.rb:117:in `block in update'
app/models/taxonomy.rb:41:in `block in no_taxonomy_scope'
app/models/taxonomy.rb:48:in `block (2 levels) in as_taxonomy'
app/models/concerns/foreman/thread_session.rb:143:in `as_location'
app/models/taxonomy.rb:47:in `block in as_taxonomy'
app/models/concerns/foreman/thread_session.rb:108:in `as_org'
app/models/taxonomy.rb:46:in `as_taxonomy'
app/models/taxonomy.rb:40:in `no_taxonomy_scope'
app/controllers/hosts_controller.rb:109:in `update'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call'

Associated revisions

Revision 89730c3c
Added by Trey Dockendorf about 3 years ago

fixes #6358 - Update LookupValue fqdn matchers when a host is renamed

History

#1 Updated by Dominic Cleal over 3 years ago

  • Category set to Smart Variables

#2 Updated by Dominic Cleal about 3 years ago

  • Status changed from New to Ready For Testing
  • Assigned To set to Trey Dockendorf
  • Target version set to Sprint 25
  • Release set to 1.5.2

#3 Updated by Trey Dockendorf about 3 years ago

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

#4 Updated by Bryan Kearney about 3 years ago

  • Bugzilla link set to 1117834

Also available in: Atom PDF