mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
We don't have the file from the master when it is not a template
Because the minion only downloads the file to eval if it is a template we can't eveluate the diff. We need to add some more to this but for now it will fix #1156
This commit is contained in:
parent
8e4be889c9
commit
3c1f9e2981
@ -596,12 +596,16 @@ def _check_file_meta(
|
||||
return changes
|
||||
if 'hsum' in source_sum:
|
||||
if source_sum['hsum'] != stats['sum']:
|
||||
with nested(open(sfn, 'rb'), open(name, 'rb')) as (src, name_):
|
||||
slines = src.readlines()
|
||||
nlines = name_.readlines()
|
||||
changes['diff'] = (
|
||||
''.join(difflib.unified_diff(nlines, slines))
|
||||
)
|
||||
if sfn:
|
||||
with nested(open(sfn, 'rb'), open(name, 'rb')) as (src, name_):
|
||||
slines = src.readlines()
|
||||
nlines = name_.readlines()
|
||||
changes['diff'] = (
|
||||
''.join(difflib.unified_diff(nlines, slines))
|
||||
)
|
||||
else:
|
||||
# TODO Evaluate diff without downloading file from master
|
||||
changes['sum'] = 'Checksum differs'
|
||||
if not user is None and user != stats['user']:
|
||||
changes['user'] = user
|
||||
if not group is None and group != stats['group']:
|
||||
|
Loading…
Reference in New Issue
Block a user