From a6c713838503ca00bf3e381126ddadb871c3825a Mon Sep 17 00:00:00 2001 From: Daniel Vincze Date: Thu, 4 Jul 2024 20:12:43 +0300 Subject: [PATCH] Skip fstab mountpoints that are not valid directory paths 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. --- coriolis/osmorphing/osmount/base.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/coriolis/osmorphing/osmount/base.py b/coriolis/osmorphing/osmount/base.py index bebf46a1..0ce5d405 100644 --- a/coriolis/osmorphing/osmount/base.py +++ b/coriolis/osmorphing/osmount/base.py @@ -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 "