1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-26 09:57:23 +03:00

B #-: Fix fail access to fileName on empty CDs (#3966)

When a template or VM has a CDrom unit without file attached,
an error was raised trying to access to fileName attribute
because that attribute doesn't exist.
This commit is contained in:
Angel Luis Moya Gonzalez 2019-11-20 23:07:24 +01:00 committed by Tino Vázquez
parent d4066bfa03
commit fa8b060ca9

View File

@ -1695,7 +1695,7 @@ module VCenterDriver
vm.config.hardware.device.each do |disk|
if is_disk_or_cdrom?(disk)
# Let's try to find if disks is persistent
source_unescaped = disk.backing.fileName.sub(/^\[(.*?)\] /, "")
source_unescaped = disk.backing.fileName.sub(/^\[(.*?)\] /, "") rescue next
source = VCenterDriver::FileHelper.escape_path(source_unescaped)
persistent = VCenterDriver::VIHelper.find_persistent_image_by_source(source, ipool)