Project

General

Profile

Bug #11258

Can't update BMC through API without specifying provider

Added by Marek Hulán over 3 years ago. Updated 5 months ago.

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

Description

When trying to update or create BMC interface through API I get the following response

{
  "error": {"message":"undefined method `upcase!' for nil:NilClass"}
}

looking at production log I found following trace

2015-07-30T14:40:01 [app] [W] Action failed
 | NoMethodError: undefined method `upcase!' for nil:NilClass
 | /home/ares/Projekty/Zdrojaky/foreman/app/models/nic/bmc.rb:5:in `block in <class:BMC>'
 | /home/ares/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:473:in `_run__1304768842026040595__validation__60779692721052316__callbacks'
 | /home/ares/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:405:in `__run_callback'
 | /home/ares/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:385:in `_run_validation_callbacks'
 | /home/ares/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:81:in `run_callbacks'
 | /home/ares/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/activemodel-3.2.21/lib/active_model/validations/callbacks.rb:53:in `run_validations!'
 | /home/ares/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/activemodel-3.2.21/lib/active_model/validations.rb:195:in `valid?'
 | /home/ares/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/activerecord-3.2.21/lib/active_record/validations.rb:69:in `valid?'
 | /home/ares/Projekty/Zdrojaky/foreman/app/models/concerns/orchestration.rb:59:in `valid?'

To reproduce:

curl -k -uadmin:changeme https://localhost:443/api/hosts/bmcipmi.example.com/interfaces/ -X POST -d '{"identifier": "ipmi2", "username": "root", "mac": "aa:bb:cc:dd:aa:bb", "type":"bmc"}' -H 'Content-Type: application/json'

Related issues

Related to Foreman - Bug #11244: MAC taken error when updating NIC IPMI details through APIResolved2015-07-29

Associated revisions

Revision 3b27c173 (diff)
Added by Marek Hulán over 3 years ago

Fixes #11258 - validation handles blank provider

Revision 2c3cd215 (diff)
Added by Marek Hulán over 3 years ago

Fixes #11258 - validation handles blank provider

(cherry picked from commit 3b27c173467c3ab4b53e844913cfd559b78d44ac)

History

#1 Updated by The Foreman Bot over 3 years ago

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

#2 Updated by Marek Hulán over 3 years ago

  • Related to Bug #11244: MAC taken error when updating NIC IPMI details through API added

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

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

#4 Updated by Dominic Cleal over 3 years ago

  • Legacy Backlogs Release (now unused) set to 72

Also available in: Atom PDF