Project

General

Profile

Actions

Bug #11258

closed

Can't update BMC through API without specifying provider

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

Status:
Closed
Priority:
Normal
Assignee:
Category:
BMC
Target version:
Difficulty:
Triaged:
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 1 (0 open1 closed)

Related to Foreman - Bug #11244: MAC taken error when updating NIC IPMI details through APIResolvedMarek Hulán07/29/2015Actions
Actions #1

Updated by The Foreman Bot over 8 years ago

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

Updated by Marek Hulán over 8 years ago

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

Updated by Marek Hulán over 8 years ago

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

Updated by Dominic Cleal over 8 years ago

  • translation missing: en.field_release set to 72
Actions

Also available in: Atom PDF