mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #40193 from rallytime/bp-40117
Back-port #40117 to 2016.3
This commit is contained in:
commit
d1abb4cbaa
1 changed files with 5 additions and 1 deletions
|
@ -2059,7 +2059,11 @@ def directory(name,
|
|||
if not os.path.isabs(name):
|
||||
return _error(
|
||||
ret, 'Specified file {0} is not an absolute path'.format(name))
|
||||
if os.path.isfile(name) or (not allow_symlink and os.path.islink(name)):
|
||||
|
||||
# Check for existing file or symlink
|
||||
if os.path.isfile(name) or (not allow_symlink and os.path.islink(name)) \
|
||||
or (force and os.path.islink(name)):
|
||||
# Was a backupname specified
|
||||
if backupname is not None:
|
||||
# Make a backup first
|
||||
if os.path.lexists(backupname):
|
||||
|
|
Loading…
Add table
Reference in a new issue