RedHat 网络安装,对NFS URL的格式要求很高哦

今天用nfs://host/dir的格式安装失败了。后来看了python-virtinst-0.400.3-5.el5包里面DistroInstaller.py文件的源码,发现其中有一步是转换NFS URL的格式:
def _sanitize_url(url):
"""
Do nothing for http or ftp, but make sure nfs is in the expected format
"""
if url.startswith("nfs://"):
# Convert RFC compliant NFS      nfs://server/path/to/distro
# to what mount/anaconda expect  nfs:server:/path/to/distro
# and carry the latter form around internally
url = "nfs:" + url[6:]

# If we need to add the : after the server
index = url.find("/", 4)
if index == -1:
raise ValueError(_("Invalid NFS format: No path specified."))
if url[index - 1] != ":":
url = url[:index] + ":" + url[index:]

return url
于是按照它那个写成nfs:host:/dir 就成功了。估计是转换脚本没有正常运行造成的

This entry was posted in 默认分类 and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *