Merge pull request #31442 from sastorsl/salt-modules-file.py-copy-check-src

Add os.path.exists(src) to file.py, def copy
This commit is contained in:
Nicole Thomas 2016-02-23 16:40:03 -07:00
commit 26733ce988

View file

@ -2427,6 +2427,9 @@ def copy(src, dst, recurse=False, remove_existing=False):
if not os.path.isabs(src):
raise SaltInvocationError('File path must be absolute.')
if not os.path.exists(src):
raise CommandExecutionError('No such file or directory \'{0}\''.format(src))
if not salt.utils.is_windows():
pre_user = get_user(src)
pre_group = get_group(src)