Added if condition for broken link.

This commit is contained in:
Narendra Ingale 2017-03-17 20:18:38 +05:30 committed by rallytime
parent d4e6c58526
commit a9107cde44

View file

@ -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):