use abspath, do not eliminating symlinks

realpath will eliminating symlinks, so following sls won't work as expected

/root/a:
  file.directory:
    - user: root
    - group: root
    - mode: 0755
    - clean: True
    - require:
      - file: /root/a/b

/root/a/b:
  file.symlink:
    - user: root
    - group: root
    - target: /etc
This commit is contained in:
Z. Liu 2015-05-15 14:47:45 +08:00 committed by rallytime
parent f3ca682f92
commit fb32c32065

View file

@ -321,8 +321,8 @@ def _gen_keep_files(name, require):
'''
Check whether ``path`` is child of ``directory``
'''
path = os.path.realpath(path)
directory = os.path.realpath(directory)
path = os.path.abspath(path)
directory = os.path.abspath(directory)
relative = os.path.relpath(path, directory)