From 66163f81f4dd36c8dc8150cf2575a94c521019a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Gonz=C3=A1lez?= Date: Tue, 9 Mar 2021 18:09:48 +0100 Subject: [PATCH] F #5228: fix find device method (#929) --- src/vmm_mad/remotes/lib/lxc/opennebula_vm.rb | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/vmm_mad/remotes/lib/lxc/opennebula_vm.rb b/src/vmm_mad/remotes/lib/lxc/opennebula_vm.rb index dd8a95811f..75d9ce7bad 100644 --- a/src/vmm_mad/remotes/lib/lxc/opennebula_vm.rb +++ b/src/vmm_mad/remotes/lib/lxc/opennebula_vm.rb @@ -323,20 +323,15 @@ class Disk sys_parts = Storage.lsblk('') device = '' - real_path = @mountpoint - is_shared_ds = File.symlink?(@sysds_path) - - real_path = File.realpath(real_path) if !@is_rootfs && is_shared_ds - sys_parts.each do |d| - if d['mountpoint'] == real_path + if d['mountpoint'] == @mountpoint device = d['path'] break end if d['children'] d['children'].each do |c| - next unless c['mountpoint'] == real_path + next unless c['mountpoint'] == @mountpoint device = d['path'] break @@ -347,7 +342,7 @@ class Disk end if device.empty? - OpenNebula.log_error("Cannot detect block device from #{real_path}") + OpenNebula.log_error("Cannot detect block device from #{@mountpoint}") end device