stages/oscap.remediation: small import adjustment

This is a small adjustment to how the `osbuild.util.mnt.mount` fuction
is imported. While adding unit tests, the tests failed when trying to
patch the function, this commit fixes the issue.
This commit is contained in:
Gianluca Zuccarelli 2024-05-28 18:18:45 +01:00 committed by Achilleas Koutsou
parent a1beb4d295
commit 24c26e7787

View file

@ -4,7 +4,7 @@ import subprocess
import sys import sys
import osbuild.api import osbuild.api
from osbuild.util.mnt import mount from osbuild.util import mnt
DATA_DIR = "/root" DATA_DIR = "/root"
XCCDF_RESULTS = "oscap_eval_xccdf_results.xml" XCCDF_RESULTS = "oscap_eval_xccdf_results.xml"
@ -15,7 +15,7 @@ def setup_env(tree):
for source in ("/dev", "/proc"): for source in ("/dev", "/proc"):
target = os.path.join(tree, source.lstrip("/")) target = os.path.join(tree, source.lstrip("/"))
os.makedirs(target, exist_ok=True) os.makedirs(target, exist_ok=True)
mount(source, target, ro=False) mnt.mount(source, target, ro=False)
os.symlink("/proc/self/fd", f"{tree}/dev/fd") os.symlink("/proc/self/fd", f"{tree}/dev/fd")