Project

General

Profile

Bug #8456

undefined local variable or method `normalize_addresses' for #<Host::Discovered:0x000000102dbdc8>

Added by Dominic Cleal almost 5 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
High
Assignee:
Category:
Importers
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Since #7908, discovery fails to import facts with the following error:

undefined local variable or method `normalize_addresses' for #<Host::Discovered:0x000000102dbdc8> (NameError)
/usr/local/rvm/gems/ruby-1.9.3-p392@test_plugin_pull_request-3/gems/activemodel-3.2.20/lib/active_model/attribute_methods.rb:407:in `method_missing'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_plugin_pull_request-3/gems/activerecord-3.2.20/lib/active_record/attribute_methods.rb:149:in `method_missing'
/var/lib/workspace/workspace/test_plugin_pull_request/database/mysql/ruby/1.9.3/foreman/app/models/host/base.rb:85:in `populate_fields_from_facts'
/var/lib/workspace/workspace/test_plugin_pull_request/database/mysql/ruby/1.9.3/plugin/app/models/host/discovered.rb:81:in `populate_fields_from_facts'
/var/lib/workspace/workspace/test_plugin_pull_request/database/mysql/ruby/1.9.3/foreman/app/models/host/base.rb:61:in `import_facts'
/var/lib/workspace/workspace/test_plugin_pull_request/database/mysql/ruby/1.9.3/plugin/app/models/host/discovered.rb:71:in `import_facts'
/var/lib/workspace/workspace/test_plugin_pull_request/database/mysql/ruby/1.9.3/plugin/app/models/host/discovered.rb:63:in `import_host_and_facts'
/var/lib/workspace/workspace/test_plugin_pull_request/database/mysql/ruby/1.9.3/plugin/test/unit/host_discovered_test.rb:19:in `block in <class:HostDiscoveredTest>'

http://ci.theforeman.org/job/test_plugin_pull_request/172/database=mysql,ruby=1.9.3/testReport/junit/%28root%29/HostDiscoveredTest/test_0002_should_import_facts_from_yaml_as_Host__Discovered/

I'm logging this under core, as I don't think Host::Base should be calling a method that's only defined on Host::Managed. It should probably be moved up a level.


Related issues

Related to Foreman - Bug #7908: mac address toggle between lower case and upper case in audit logsClosed2014-10-12

Associated revisions

Revision f7bedf48 (diff)
Added by Marek Hulán over 4 years ago

Fixes #8456 - normalize addresses only if mac is being set

Revision 11ec731c (diff)
Added by Marek Hulán over 4 years ago

Fixes #8456 - normalize addresses only if mac is being set

(cherry picked from commit f7bedf484daf4a647afb078666822d25aae0f016)

History

#1 Updated by Dominic Cleal almost 5 years ago

  • Related to Bug #7908: mac address toggle between lower case and upper case in audit logs added

#2 Updated by Marek Hulán almost 5 years ago

  • Assignee set to Marek Hulán

Yeah the reason was that there was no place to hook before saving in Host::Base, the other option was to normalize mac during assignment. I'll look at that tomorrow.

#3 Updated by The Foreman Bot almost 5 years ago

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

#4 Updated by Marek Hulán over 4 years ago

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

Also available in: Atom PDF