Skip to content

Commit

Permalink
Reconnect existing ISO Datastores
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed May 24, 2023
1 parent 94295f4 commit b656737
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,17 @@ def add_resource_pools
end

def add_storages
iso_datastores_reconnect_block = lambda do |inventory_collection, inventory_objects_index, attributes_index|
# You can only have a single ISO datastore per Ovirt datacenter
iso_datastore = inventory_collection.parent.iso_datastores.first
return if iso_datastore.nil?

_, data = inventory_objects_index.detect { |_ref, data| data[:store_type] == "ISO" }
data.id = iso_datastore.id
end

add_collection(infra, :storages) do |builder|
builder.add_properties(:custom_reconnect_block => iso_datastores_reconnect_block)
if targeted?
builder.add_targeted_arel(
lambda do |_inventory_collection|
Expand Down

0 comments on commit b656737

Please sign in to comment.