1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

B #1699: Fix importing wild machines and swap datastores (#2911)

This commit is contained in:
Sergio Semedi Barranco 2019-02-08 11:29:04 +01:00 committed by Tino Vázquez
parent e95b4ef738
commit 7c0a1ffadb

View File

@ -805,7 +805,6 @@ class Template
end
def vm_to_one(vm_name)
str = "NAME = \"#{vm_name}\"\n"\
"CPU = \"#{@vm_info["config.hardware.numCPU"]}\"\n"\
"vCPU = \"#{@vm_info["config.hardware.numCPU"]}\"\n"\
@ -899,15 +898,17 @@ class Template
break
end
end
else
if !@vm_info["datastore"]._ref.nil?
ds_ref = @vm_info["datastore"]._ref
elsif @vm_info["datastore"].length == 1
if !@vm_info["datastore"].first._ref.nil?
ds_ref = @vm_info["datastore"].first._ref
end
end
return ds_ref
return ds_ref
rescue StandardError => e
error = "Could not find DATASTORE for this VM. Reason: #{e.message}"
return error
return error
end
end