Skip to content

Commit

Permalink
Skip fstab mountpoints that are not valid directory paths
Browse files Browse the repository at this point in the history
This commit aims to fix an issue where multiple swap partitions that have
the same 'none' or 'swap' as mountpoint. In order to achieve this, the linux
OSMount tools will skip any mountpoint that is not a valid directory.
  • Loading branch information
Dany9966 committed Jul 4, 2024
1 parent 87401a6 commit af49e5c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions coriolis/osmorphing/osmount/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,13 @@ def _check_mount_fstab_partitions(

device = match.group(2)
mountpoint = match.group(3)

if not mountpoint.startswith('/'):
LOG.warning(
f"Skipping mountpoint that is not a valid directory: "
f"{mountpoint}")
continue

if mountpoint in mounts:
raise exception.CoriolisException(
"Mountpoint '%s' appears to be mounted twice in "
Expand Down

0 comments on commit af49e5c

Please sign in to comment.