Project

General

Profile

« Previous | Next » 

Revision 96ede451

Added by Amos Benari about 12 years ago

  • ID 96ede451fc45d6d8e5786d62d4c92adc97c46ad3

fixes #1574 - ovirt - add remove and show volumes

  • volume and interface ordering is now working
  • removed include blank because it is a duplicate of the Blank ovirt-template.
  • bootable is disabled when editing a vm, because currently I don't handle volume updates. just add and remove of a volume.
  • Volumes are created in the order that they where created in the gui. Bootable is set by default to the first volume.
  • update to the latest rbovirt gem.

View differences:

lib/foreman/model/libvirt.rb
}
end
def nested_attributes_for type, opts
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 = 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
else
v.delete(:"_delete")
v.symbolize_keys # convert to symbols deeper hashes
end
end.compact
end
def create_volumes args
vols = []
(volumes = args[:volumes]).each do |vol|

Also available in: Unified diff