Actions
Bug #16545
closedHost node YAML import calls AR finder with incorrect second argument
Description
Under Rails 5, the Host::Managed#importNode method raises an error when importing a YAML file that contains parameterised classes (as in our unit test):
HostTest::location or organizations are not enabled.test_0013_should import from external nodes output
TypeError: can't quote Hash
app/models/host/managed.rb:489:in `block in importNode'
app/models/host/managed.rb:488:in `each'
app/models/host/managed.rb:488:in `importNode'
test/unit/host_test.rb:757:in `block (2 levels) in <class:HostTest>' (TypeError)
/usr/local/rvm/gems/ruby-2.3.0@test_develop_pr_core-2/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/quoting.rb:177
On Rails 4, calling Puppetclass.find_by_name(["klass", {:params => foo}]) was just returning the klass and ignoring the second element of the array. Under Rails 5 it raises an error.
The .find_by_name call should only be passed a string with a name.
Note that the classes in an ENC YAML may be either an array or hash, but the unit test only checks the hash format.
Updated by The Foreman Bot almost 10 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/3842 added
Updated by Dominic Cleal almost 10 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 37c0b37ff2654b769f95812f27471baedc0ecaae.
Updated by Dominic Cleal almost 10 years ago
- Translation missing: en.field_release set to 189
Actions