Skip to content

Commit

Permalink
use abspath, do not eliminating symlinks
Browse files Browse the repository at this point in the history
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
  • Loading branch information
clan authored and rallytime committed May 16, 2015
1 parent f3ca682 commit fb32c32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions salt/states/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ def _is_child(path, directory):
'''
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)

Expand Down

0 comments on commit fb32c32

Please sign in to comment.