Project

General

Profile

« Previous | Next » 

Revision 1721eaee

Added by Ohad Levy about 12 years ago

  • ID 1721eaeeee76d4278a6ec47f6bfa829057e91967

minor ordering issue for nics/disks when creating libvirt instances, refs #1452

View differences:

lib/foreman/model/libvirt.rb
def client
# WARNING potential connection leak
Thread.current[url] ||= ::Fog::Compute.new(:provider => "Libvirt", :libvirt_uri => url)
Thread.current[id] ||= ::Fog::Compute.new(:provider => "Libvirt", :libvirt_uri => url)
end
def disconnect
......
return unless opts
opts.delete("new_#{type}") # delete template
# convert our options hash into a sorted array (e.g. to preserve nic / disks order)
opts.sort { |l, r| l[0][0] <=> r[0][0] }.map { |e| Hash[e[1]] }
opts = opts.sort { |l, r| l[0][0] <=> r[0][0] }.map { |e| Hash[e[1]] }
opts.map do |k, v|
if v[:"_delete"] == '1'
nil

Also available in: Unified diff