mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
quote source file name in file mod error messages
This commit is contained in:
parent
f58f3dac1d
commit
db0f85a882
1 changed files with 5 additions and 5 deletions
|
@ -3120,7 +3120,7 @@ def get_managed(
|
|||
# exists doesn't play nice with sfn as bool
|
||||
# but if cache failed, sfn == False
|
||||
if not sfn or not os.path.exists(sfn):
|
||||
return sfn, {}, 'Source file {0} not found'.format(source)
|
||||
return sfn, {}, 'Source file {0!r} not found'.format(source)
|
||||
if sfn == name:
|
||||
raise SaltInvocationError(
|
||||
'Source file cannot be the same as destination'
|
||||
|
@ -3161,7 +3161,7 @@ def get_managed(
|
|||
if _urlparse(source).scheme == 'salt':
|
||||
source_sum = __salt__['cp.hash_file'](source, saltenv)
|
||||
if not source_sum:
|
||||
return '', {}, 'Source file {0} not found'.format(source)
|
||||
return '', {}, 'Source file {0!r} not found'.format(source)
|
||||
elif source_hash:
|
||||
protos = ['salt', 'http', 'https', 'ftp', 'swift', 's3']
|
||||
if _urlparse(source_hash).scheme in protos:
|
||||
|
@ -3723,7 +3723,7 @@ def manage_file(name,
|
|||
sfn = __salt__['cp.cache_file'](source, saltenv)
|
||||
if not sfn:
|
||||
return _error(
|
||||
ret, 'Source file {0} not found'.format(source))
|
||||
ret, 'Source file {0!r} not found'.format(source))
|
||||
# If the downloaded file came from a non salt server source verify
|
||||
# that it matches the intended sum value
|
||||
if _urlparse(source).scheme != 'salt':
|
||||
|
@ -3814,7 +3814,7 @@ def manage_file(name,
|
|||
sfn = __salt__['cp.cache_file'](source, saltenv)
|
||||
if not sfn:
|
||||
return _error(
|
||||
ret, 'Source file {0} not found'.format(source))
|
||||
ret, 'Source file {0!r} not found'.format(source))
|
||||
# If the downloaded file came from a non salt server source verify
|
||||
# that it matches the intended sum value
|
||||
if _urlparse(source).scheme != 'salt':
|
||||
|
@ -3883,7 +3883,7 @@ def manage_file(name,
|
|||
sfn = __salt__['cp.cache_file'](source, saltenv)
|
||||
if not sfn:
|
||||
return _error(
|
||||
ret, 'Source file {0} not found'.format(source))
|
||||
ret, 'Source file {0!r} not found'.format(source))
|
||||
# If the downloaded file came from a non salt server source verify
|
||||
# that it matches the intended sum value
|
||||
if _urlparse(source).scheme != 'salt':
|
||||
|
|
Loading…
Add table
Reference in a new issue