Bug #6358

Renaming host orphans lookup_values

Added by Trey Dockendorf about 4 years ago. Updated 7 days ago.

Status:Closed
Priority:Normal
Assignee:Trey Dockendorf
Category:Smart Variables
Target version:1.5.2
Difficulty: Team Backlog:
Triaged: Fixed in Releases:
Bugzilla link:1117834 Found in Releases:1.5.0
Pull request:

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 4 years ago

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

Revision 067bb098
Added by Trey Dockendorf almost 4 years ago

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

(cherry picked from commit 89730c3c8e21eb6c05770728ba425e817a03f3e0)

Conflicts:
app/models/host/managed.rb

History

#1 Updated by Dominic Cleal about 4 years ago

  • Category set to Smart Variables

#2 Updated by Dominic Cleal about 4 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Trey Dockendorf
  • Target version set to 1.8.1
  • Legacy Backlogs Release (now unused) set to 18

#3 Updated by Trey Dockendorf about 4 years ago

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

#4 Updated by Bryan Kearney about 4 years ago

  • Bugzilla link set to 1117834

Also available in: Atom PDF