mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Added if condition for broken link.
This commit is contained in:
parent
d4e6c58526
commit
a9107cde44
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 not os.path.exists(os.readlink(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