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:

app/models/compute_resource.rb
(0...n).map { chars[rand(chars.length)].chr }.join
end
def nested_attributes_for type, opts
return [] unless opts
opts = opts.dup #duplicate to prevent changing the origin 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].sub('new_','').to_i <=> r[0].sub('new_','').to_i }.map { |e| Hash[e[1]] }
opts.map do |v|
if v[:"_delete"] == '1' && v[:id].nil?
nil
else
v.symbolize_keys # convert to symbols deeper hashes
end
end.compact
end
end

Also available in: Unified diff