Replace to_hash with XPATH

This commit is contained in:
Sergio Vega committed 2019-01-10 10:38:43 -06:00
1 parent 4c4f271284
commit a177d6fc48
1 file changed
+1 -1
+1 -1
View File
@@ -45,7 +45,7 @@ begin
one_client = OpenNebula::Client.new
vm = OpenNebula::VirtualMachine.new_with_id(vmid, one_client)
vm.info
src_ds = vm.to_hash["VM"]["HISTORY_RECORDS"]["HISTORY"][-2]["DS_ID"]
src_ds = vm.retrieve_elements("HISTORY_RECORDS/HISTORY/DS_ID")[-2]
if src_ds == dsid
VCenterDriver::VirtualMachine.migrate_routine(vmid, host_orig, host_dest)