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

M #-: rsync/stat script to work with all Ruby versions

This commit is contained in:
Ruben S. Montero 2022-12-14 11:29:38 +01:00
parent 595d73ba32
commit a07a2cf97a
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

View File

@ -107,8 +107,8 @@ end
vm = REXML::Document.new(Base64.decode64(rc.stdout)).root
xpath = "/VM/TEMPLATE/DISK[ DISK_ID = #{diskid[1]} ]/SIZE"
# Done in two steps to support all Ruby versions
xpath = "/VM/TEMPLATE/DISK [ DISK_ID = #{diskid[1]} ]"
disk = vm.elements[xpath]
if !disk
@ -116,6 +116,13 @@ if !disk
exit(1)
end
puts disk.text
size = disk.elements['//SIZE']
if !size
STDERR.puts "Cannot find size for disk #{diskid[1]} in VM backup info"
exit(1)
end
puts size.text
exit 0