Check for link in path in utils.path_dwim_relative()
This allows an included path to be relative to a directory, if the basedir of the original path is a symlink. In that case, the path is normalized and the file is searched for in the normalized path. Fixes #3312
This commit is contained in:
parent
d2bf244eb8
commit
d0236f6ada
1 changed files with 5 additions and 1 deletions
|
@ -254,6 +254,10 @@ def path_dwim_relative(original, dirname, source, playbook_base, check=True):
|
||||||
# (used by roles code)
|
# (used by roles code)
|
||||||
|
|
||||||
basedir = os.path.dirname(original)
|
basedir = os.path.dirname(original)
|
||||||
|
if os.path.islink(basedir):
|
||||||
|
basedir = unfrackpath(basedir)
|
||||||
|
template2 = os.path.join(basedir, dirname, source)
|
||||||
|
else:
|
||||||
template2 = os.path.join(basedir, '..', dirname, source)
|
template2 = os.path.join(basedir, '..', dirname, source)
|
||||||
source2 = path_dwim(basedir, template2)
|
source2 = path_dwim(basedir, template2)
|
||||||
if os.path.exists(source2):
|
if os.path.exists(source2):
|
||||||
|
|
Loading…
Add table
Reference in a new issue