From 81323e4af75e2ed842d6fc1c257cd84cd42778f3 Mon Sep 17 00:00:00 2001 From: Mihaela Balutoiu Date: Fri, 13 Sep 2024 16:53:22 +0300 Subject: [PATCH] Fix mounting of non-existent devices Added a check to ensure the device exists before attempting to mount it. Signed-off-by: Mihaela Balutoiu --- coriolis/osmorphing/osmount/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/coriolis/osmorphing/osmount/base.py b/coriolis/osmorphing/osmount/base.py index e521ff6c..926342c9 100644 --- a/coriolis/osmorphing/osmount/base.py +++ b/coriolis/osmorphing/osmount/base.py @@ -384,6 +384,10 @@ def _get_mounted_devices(self): colls = line.split() if colls[0].startswith("/dev"): dev_name = self._get_symlink_target(colls[0]) + if not utils.test_ssh_path(self._ssh, dev_name): + LOG.warn( + "Device name %s not found, skipping mount.", dev_name) + continue ret.append(dev_name) mounted_device_numbers.append( self._exec_cmd(dev_nmb_cmd % dev_name).decode().rstrip())