mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
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:
commit
26733ce988
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue