mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Make file.recurse work with gitfs_mountpoint
When a file.recurse state is specified for salt://foo, and there is a gitfs_remote mounted at salt://foo/bar, when the fileserver is queried for the list of directories on the master, 'foo' will not be among them, causing a pre-flight check to fail and keeping the state from running. This commit modifies that pre-flight check to also look for paths that start with 'foo/' as well, allowing salt://foo to be properly matched when a mountpoint is used.
This commit is contained in:
parent
b24af2c8b3
commit
e24554e188
@ -1645,7 +1645,10 @@ def recurse(name,
|
||||
# Check source path relative to fileserver root, make sure it is a
|
||||
# directory
|
||||
source_rel = source.partition('://')[2]
|
||||
if source_rel not in __salt__['cp.list_master_dirs'](__env__):
|
||||
master_dirs = __salt__['cp.list_master_dirs'](__env__)
|
||||
if source_rel not in master_dirs \
|
||||
and not any((x for x in master_dirs
|
||||
if x.startswith(source_rel + '/'))):
|
||||
ret['result'] = False
|
||||
ret['comment'] = (
|
||||
'The directory {0!r} does not exist on the salt fileserver'
|
||||
|
Loading…
Reference in New Issue
Block a user