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:
parent
595d73ba32
commit
a07a2cf97a
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user