Project

General

Profile

Actions

Bug #13084

closed

undefined method `find_by_ip' during validation of IP retrieved from compute resource

Added by Dominic Cleal about 8 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Category:
Compute resources
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

When creating a Rackspace CR-based host, the following error is thrown in orchestration:

 | NoMethodError: undefined method `find_by_ip' for #<Class:0x0000000adce650>
 | /home/dcleal/.rvm/gems/ruby-2.0.0-p353@foreman/gems/activerecord-4.1.5/lib/active_record/dynamic_matchers.rb:26:in `method_missing'
 | /home/dcleal/code/foreman/foreman/app/models/host.rb:15:in `method_missing'
 | /home/dcleal/code/foreman/foreman/app/models/concerns/orchestration/compute.rb:285:in `validate_foreman_attr'
 | /home/dcleal/code/foreman/foreman/app/models/concerns/orchestration/compute.rb:135:in `block in setComputeDetails'
 | /home/dcleal/code/foreman/foreman/app/models/concerns/orchestration/compute.rb:122:in `each'
 | /home/dcleal/code/foreman/foreman/app/models/concerns/orchestration/compute.rb:122:in `setComputeDetails'
 | /home/dcleal/code/foreman/foreman/app/models/concerns/orchestration.rb:162:in `execute'
 | /home/dcleal/code/foreman/foreman/app/models/concerns/orchestration.rb:107:in `block in process'
 | /home/dcleal/code/foreman/foreman/app/models/concerns/orchestration.rb:99:in `each'
 | /home/dcleal/code/foreman/foreman/app/models/concerns/orchestration.rb:99:in `process'
 | /home/dcleal/code/foreman/foreman/app/models/concerns/orchestration.rb:35:in `on_save'

I suspect this may affect other CR types that retrieve IP addresses, such as EC2/OpenStack.

Those that retrieve MACs seem OK as the match_macs_to_nics method calls the same function, but passing in Nic::Base instead of Host.


Related issues 1 (0 open1 closed)

Related to Foreman - Refactor #10988: Remove 1.11 deprecationsClosedDaniel Lobato Garcia07/02/2015Actions
Actions #1

Updated by Dominic Cleal about 8 years ago

Actions #2

Updated by Lukas Zapletal about 8 years ago

Tried with OS, this is what it gets passed in:

[1] pry(#<Foreman::Model::Openstack>)> args
=> {"flavor_ref"=>"83098b08-7339-4089-bc07-3f2a14b7a4c1",
 "availability_zone"=>"",
 "tenant_id"=>"2f58867f4fa54a09a266b26ef410d311",
 "security_groups"=>"xxx-sec-group",
 "nics"=>[""],
 "network"=>"os1_internal",
 "boot_from_volume"=>"false",
 "size_gb"=>"",
 "image_ref"=>"2695dbd9-e1b1-47a8-9ac3-4e8854aa55aa",
 "interfaces_attributes"=>{"0"=>{}},
 :name=>"lzap-test-01.local.lan",
 :provision_method=>"image"}

It looks like the hash has no indiffrent access. Once I fix this, I get the very same error there.

Actions #3

Updated by Lukas Zapletal about 8 years ago

Comment deleted.

Actions #4

Updated by The Foreman Bot about 8 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Lukas Zapletal
  • Pull request https://github.com/theforeman/foreman/pull/3052 added
Actions #5

Updated by Lukas Zapletal about 8 years ago

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

Also available in: Atom PDF