代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/anaconda 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 6317147760315ebc269470b3fdb3f66eaeefe9b2 Mon Sep 17 00:00:00 2001
From: Jiri Konecny <jkonecny@redhat.com>
Date: Fri, 19 Jun 2020 13:24:57 +0200
Subject: [PATCH] Fix issue when NFS path is pointing directly to ISO
(#1848718)
This is totally my fault... The problem is that I thought that this will happen
when mounting and finding the ISO but not for the NFS mount. NFS mount can't be
done for an ISO image but only for the directory.
Resolves: rhbz#1848718
Resolves: rhbz#1849083
Reported-by: Adam Williamson <awilliam@redhat.com>
---
.../payloads/source/nfs/initialization.py | 28 ++++++++++++++++---
1 file changed, 24 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/modules/payloads/source/nfs/initialization.py b/pyanaconda/modules/payloads/source/nfs/initialization.py
index 99601bf32..f21c641ea 100644
--- a/pyanaconda/modules/payloads/source/nfs/initialization.py
+++ b/pyanaconda/modules/payloads/source/nfs/initialization.py
@@ -19,6 +19,7 @@ import os.path
from pyanaconda.anaconda_loggers import get_module_logger
from pyanaconda.core.payload import parse_nfs_url
+from pyanaconda.core.util import join_paths
from pyanaconda.modules.common.errors.payload import SourceSetupError
from pyanaconda.modules.common.task import Task
from pyanaconda.modules.payloads.source.utils import find_and_mount_iso_image, \
@@ -54,12 +55,16 @@ class SetUpNFSSourceTask(Task):
mount_point
))
+ options, host, path = parse_nfs_url(self._url)
+ path, image = self._split_iso_from_path(path)
try:
- self._mount_nfs()
+ self._mount_nfs(host, options, path)
except PayloadSetupError:
raise SourceSetupError("Could not mount NFS url '{}'".format(self._url))
- iso_name = find_and_mount_iso_image(self._device_mount, self._iso_mount)
+ iso_source_path = join_paths(self._device_mount, image) if image else self._device_mount
+
+ iso_name = find_and_mount_iso_image(iso_source_path, self._iso_mount)
if iso_name:
log.debug("Using the ISO '%s' mounted at '%s'.", iso_name, self._iso_mount)
@@ -74,9 +79,24 @@ class SetUpNFSSourceTask(Task):
raise SourceSetupError(
"Nothing useful found for NFS source at {}".format(self._url))
- def _mount_nfs(self):
- options, host, path = parse_nfs_url(self._url)
+ @staticmethod
+ def _split_iso_from_path(path):
+ """Split ISO from NFS path.
+
+ NFS path could also contain pointer to ISO which should be mounted. Problem of this
+ is that NFS path with ISO cannot be mounted as NFS mount. We have to split these
+ before mount.
+
+ :param path: path on the NFS server which could point to ISO
+ :return: tuple of path, iso_file_name; is_file_name is empty if no ISO is part of the path
+ :rtype: tuple (str, str)
+ """
+ if path.endswith(".iso"):
+ return path.rsplit("/", maxsplit=1)
+
+ return path, ""
+ def _mount_nfs(self, host, options, path):
if not options:
options = "nolock"
elif "nolock" not in options:
--
2.23.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。