Skip to content

Commit

Permalink
CP-49641: Ignore errors mounting/unmounting explicit mount points
Browse files Browse the repository at this point in the history
Code to handle "mount=" options were rewritten adding additional
error checking.
However this resulted in a feature regression as this poor error
handling is used as a "try next if fails" behavior allowing
to specify multiple devices for the same mount point. For
instance specifying
"mount=/dev/sda2:/mnt mount=/dev/disk/by-label/DEMO:/mnt" for the same
"/mnt" mount point the two possible device names were attempted.
So instead of giving error log the error and continue to restore
the old behavior.

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
  • Loading branch information
freddy77 committed May 23, 2024
1 parent 27efb59 commit 7463132
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions disktools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1357,11 +1357,17 @@ def __init__(self):

def mount(self):
for m in self.mounts:
m.mount()
try:
m.mount()
except Exception as e:
logger.logException(e)

def __umount(self):
for m in self.mounts:
m.umount()
try:
m.umount()
except Exception as e:
logger.logException(e)

def __enter__(self):
self.mount()
Expand Down

0 comments on commit 7463132

Please sign in to comment.