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

F #1684: Fix trymount (#2904)

This commit is contained in:
Daniel Clavijo Coca 2019-02-06 11:07:19 -06:00 committed by Ruben S. Montero
parent afc5a362bd
commit 683cbcf26e

View File

@ -44,9 +44,9 @@ class RBDMapper < Mapper
# TODO: improve wait condition
sleep 1 # wait for partition table
# TODO: deprecate workaround for ubuntu 16.04 not
# updating partition tables
try_mount(out.chomp)
device = out.chomp
try_mount(device)
device
end
def do_unmap(device, _one_vm, _disk, _directory)
@ -64,12 +64,9 @@ class RBDMapper < Mapper
# This function tries to mount mapped devices to force update of partition
# tables
def try_mount(device)
dev = device
dev += "p1" if parts_on?(device)
def try_mount(dev)
cmd = "#{COMMANDS[:mount]} --fake #{dev} /mnt"
device
Command.execute(cmd, false)
end
end