Skip to content

Commit

Permalink
Fix mounting of non-existent devices
Browse files Browse the repository at this point in the history
Added a check to ensure the device exists before
attempting to mount it.

Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
  • Loading branch information
mihaelabalutoiu authored and Dany9966 committed Sep 16, 2024
1 parent 676d6c9 commit 81323e4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions coriolis/osmorphing/osmount/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 81323e4

Please sign in to comment.