foreman_fog_proxmox
foreman_fog_proxmox copied to clipboard
fix 500 when browsing VMs in compute resource (Integer to String)
on Foreman 3.0.1, proxmox VE 7.0-11
Here is the error:
Backtrace for 'no implicit conversion of Integer into String' error (ActionView::Template::Error): no implicit conversion of Integer into String
/usr/share/foreman/vendor/ruby/2.5.0/gems/foreman_fog_proxmox-0.14.0/app/models/concerns/fog_extensions/proxmox/server.rb:27:in `+'
/usr/share/foreman/vendor/ruby/2.5.0/gems/foreman_fog_proxmox-0.14.0/app/models/concerns/fog_extensions/proxmox/server.rb:27:in `unique_cluster_identity'
/usr/share/foreman/vendor/ruby/2.5.0/gems/foreman_fog_proxmox-0.14.0/app/views/compute_resources_vms/index/_proxmox.html.erb:34:in `block in _94910306308b1e629dd9be22f5198ab2'
/usr/share/foreman/vendor/ruby/2.5.0/gems/foreman_fog_proxmox-0.14.0/app/views/compute_resources_vms/index/_proxmox.html.erb:32:in `each'
/usr/share/foreman/vendor/ruby/2.5.0/gems/foreman_fog_proxmox-0.14.0/app/views/compute_resources_vms/index/_proxmox.html.erb:32:in `_94910306308b1e629dd9be22f5198ab2'
/usr/share/foreman/vendor/ruby/2.5.0/gems/actionview-6.0.3.7/lib/action_view/base.rb:274:in `_run'
Tested this in our fresh Foreman install, works fine for us.
This change fixed the problem on my cluster.
There's actually an almost identical error on line 27 of app/models/concerns/host_ext/proxmox/for_vm.rb
where identity
also needs the .to_s
added, maybe you can include that in your PR?
I can also confirm both problems. The second one is needed to fix the 500 when clicking the "Associate" button.
I've included the change in #223
fixed with https://github.com/theforeman/foreman_fog_proxmox/pull/223