The PR fixes a bug in the convert_string_to_bool function. ATM the 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:inconvert_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:inmap'
/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:inblock 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:inconvert_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:insave'
/usr/share/foreman/app/models/compute_resources/foreman/model/ovirt.rb:242:in `start_vm'
The PR fixes a bug in the convert_string_to_bool function. ATM the 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:inblock (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:inmap' /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:ineach' /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:inupdate_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'