Bug #28121
closedconvert_string_to_bool doesn't deal with array type
Description
There is still another bug in the convert_string_to_bool function. It doesn't validate the data type of the item in value.map (when it's an array). It caused the same error. It happens when deploying a host to oVirt (from Foreman 1.23):
NoMethodError: undefined method `each' for #<Fog::Ovirt::Compute::Interface:0x007f0b76120628>
/usr/share/foreman/vendor/ruby/2.3.0/gems/fog-ovirt-1.2.1/lib/fog/ovirt/compute/v4.rb:116:in `convert_string_to_bool'
/usr/share/foreman/vendor/ruby/2.3.0/gems/fog-ovirt-1.2.1/lib/fog/ovirt/compute/v4.rb:124:in `block (2 levels) in convert_string_to_bool'
/usr/share/foreman/vendor/ruby/2.3.0/gems/fog-core-2.1.0/lib/fog/core/collection.rb:18:in `map'
/usr/share/foreman/vendor/ruby/2.3.0/gems/fog-core-2.1.0/lib/fog/core/collection.rb:18:in `map'
/usr/share/foreman/vendor/ruby/2.3.0/gems/fog-ovirt-1.2.1/lib/fog/ovirt/compute/v4.rb:124:in `block in convert_string_to_bool'
/usr/share/foreman/vendor/ruby/2.3.0/gems/fog-ovirt-1.2.1/lib/fog/ovirt/compute/v4.rb:116:in `each'
/usr/share/foreman/vendor/ruby/2.3.0/gems/fog-ovirt-1.2.1/lib/fog/ovirt/compute/v4.rb:116:in `convert_string_to_bool'
/usr/share/foreman/vendor/ruby/2.3.0/gems/fog-ovirt-1.2.1/lib/fog/ovirt/requests/compute/v4/update_vm.rb:9:in `update_vm'
/usr/share/foreman/vendor/ruby/2.3.0/gems/fog-ovirt-1.2.1/lib/fog/ovirt/models/compute/server.rb:177:in `save'
/usr/share/foreman/app/models/compute_resources/foreman/model/ovirt.rb:242:in `start_vm'
Updated by Shira Maximov about 5 years ago
- Fixed in Releases 1.24.0 added
Fixed in: https://github.com/fog/fog-ovirt/pull/77 fog-ovirt v1.2.2
foreman packaging PR - https://github.com/theforeman/foreman-packaging/pull/4315
Updated by Shira Maximov about 5 years ago
- Pull request https://github.com/theforeman/foreman/pull/7223 added
Updated by The Foreman Bot about 5 years ago
- Status changed from New to Ready For Testing
Updated by Shira Maximov about 5 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset be2913a3ac62a77ae3400c4e3e43ae2058c499a4.
Updated by Ewoud Kohl van Wijngaarden over 2 years ago
- Related to Bug #23578: bootable flag doesn't save in ovirt V4 when creating new VM added