leapp-repository/SOURCES/0096-lib-mounting-Remove-RHEL-7-nspawn-options.patch
eabdullin 37f55f86cd Import from CS git
(cherry picked from commit 3f0f8c21af)
2026-01-20 12:16:09 +02:00

46 lines
2.1 KiB
Diff

From e2be1ed71d8985e836a3a0df2fc2d1a9b47c1b99 Mon Sep 17 00:00:00 2001
From: Matej Matuska <mmatuska@redhat.com>
Date: Thu, 21 Aug 2025 19:47:47 +0200
Subject: [PATCH 096/111] lib/mounting: Remove RHEL 7 nspawn options
---
repos/system_upgrade/common/libraries/mounting.py | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/repos/system_upgrade/common/libraries/mounting.py b/repos/system_upgrade/common/libraries/mounting.py
index 279d31dc..ea59164c 100644
--- a/repos/system_upgrade/common/libraries/mounting.py
+++ b/repos/system_upgrade/common/libraries/mounting.py
@@ -5,7 +5,7 @@ import shutil
from collections import namedtuple
from leapp.libraries.common.config import get_all_envs
-from leapp.libraries.common.config.version import get_source_major_version, matches_source_version
+from leapp.libraries.common.config.version import matches_source_version
from leapp.libraries.stdlib import api, CalledProcessError, run
# Using ALWAYS_BIND will crash the upgrade process if the file does not exist.
@@ -83,12 +83,13 @@ class IsolationType:
""" Transform the command to be executed with systemd-nspawn """
binds = ['--bind={}'.format(bind) for bind in self.binds]
setenvs = ['--setenv={}={}'.format(env.name, env.value) for env in self.env_vars]
- final_cmd = ['systemd-nspawn', '--register=no', '--quiet']
- if get_source_major_version() != '7':
- # TODO: check whether we could use the --keep unit on el7 too.
- # in such a case, just add line into the previous solution..
- # TODO: the same about --capability=all
- final_cmd += ['--keep-unit', '--capability=all']
+ final_cmd = [
+ 'systemd-nspawn',
+ '--register=no',
+ '--quiet',
+ '--keep-unit',
+ '--capability=all',
+ ]
if matches_source_version('>= 9.0'):
# Disable pseudo-TTY in container
final_cmd += ['--pipe']
--
2.52.0