mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix get_managed() in file.py module for local files
This fixes the 'Unable to manage file: string indices must be integers, not str' error message problem. source_sum must be a dictionary not a string.
This commit is contained in:
parent
423d528b73
commit
1fd4837beb
1 changed files with 4 additions and 2 deletions
|
@ -2929,9 +2929,11 @@ def get_managed(
|
|||
return '', {}, 'Source file {0} not found'.format(source)
|
||||
# if its a local file
|
||||
elif urlparsed_source.scheme == 'file':
|
||||
source_sum = get_hash(urlparsed_source.path)
|
||||
file_sum = get_hash(urlparsed_source.path, form='sha256')
|
||||
source_sum = {'hsum': file_sum, 'hash_type': 'sha256'}
|
||||
elif source.startswith('/'):
|
||||
source_sum = get_hash(source)
|
||||
file_sum = get_hash(source, form='sha256')
|
||||
source_sum = {'hsum': file_sum, 'hash_type': 'sha256'}
|
||||
elif source_hash:
|
||||
protos = ('salt', 'http', 'https', 'ftp', 'swift', 's3')
|
||||
if _urlparse(source_hash).scheme in protos:
|
||||
|
|
Loading…
Add table
Reference in a new issue