Revision c2b01780

View differences:

src/vmm_mad/remotes/lib/vcenter_driver/importer.rb
57 57
        dc_ref = vcenter_vm.get_dc.item._ref
58 58
        ds_ref = template.match(/^VCENTER_DS_REF *= *"(.*)" *$/)[1]
59 59

  
60
        begin
61
            ds_one = dpool.select do |e|
62
                e["TEMPLATE/TYPE"]                == "SYSTEM_DS" &&
63
                e["TEMPLATE/VCENTER_DS_REF"]      == ds_ref &&
64
                e["TEMPLATE/VCENTER_DC_REF"]      == dc_ref &&
65
                e["TEMPLATE/VCENTER_INSTANCE_ID"] == vc_uuid
66
            end.first
67
        rescue
68
            raise "DS with ref #{ds_ref} is not imported in OpenNebula, aborting Wild VM import."
69
        end
60
        ds_one = dpool.select do |e|
61
            e["TEMPLATE/TYPE"]                == "SYSTEM_DS" &&
62
            e["TEMPLATE/VCENTER_DS_REF"]      == ds_ref &&
63
            e["TEMPLATE/VCENTER_DC_REF"]      == dc_ref &&
64
            e["TEMPLATE/VCENTER_INSTANCE_ID"] == vc_uuid
65
        end.first
66
        
67
        raise "DS with ref #{ds_ref} is not imported in OpenNebula, aborting Wild VM import." if !ds_one
70 68

  
71 69
        rc = one_vm.allocate(template)
72 70
        return rc if OpenNebula.is_error?(rc)

Also available in: Unified diff