mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-22 01:22:00 +00:00
Robust handling of relative link resolv.conf
resolv.conf may be a relative link, normal file, or absolute link. Handle all cases.
This commit is contained in:
parent
2235faa76d
commit
c91af840e5
@ -942,6 +942,8 @@ def fancy_chroot(args, installroot):
|
||||
sourceresolv = '/etc/resolv.conf'
|
||||
if os.path.islink(sourceresolv):
|
||||
sourceresolv = os.readlink(sourceresolv)
|
||||
# normalize and resolve relative and absolute paths
|
||||
sourceresolv = os.path.normpath(os.path.join('/etc', sourceresolv))
|
||||
dstresolv = os.path.join(installroot, 'etc/resolv.conf')
|
||||
if os.path.islink(dstresolv):
|
||||
dstresolv = os.path.join(installroot, os.readlink(dstresolv)[1:])
|
||||
|
Loading…
Reference in New Issue
Block a user