Umounts in the reversed order.

Sometimes unmounting order matters. Let's take the defensive approach.

(cherry picked from commit cda5a0f250)
This commit is contained in:
Carlos Nihelton 2023-03-31 10:58:14 -03:00 committed by Olivier Gayot
parent c0e7390c61
commit 53473feda4
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ def joining_context(hostname: str, root_dir: str):
hostname_process = run_command(['hostname', hostname_current])
if hostname_process.returncode:
log.info("Failed to restore live session hostname")
for bind in binds:
for bind in reversed(binds):
bound_dir = os.path.join(root_dir, bind[1:])
if bound_dir != bind:
run_command(["umount", "-f", bound_dir])