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:
Thomas S Hatch 2012-05-12 12:52:09 -06:00
parent 8e4be889c9
commit 3c1f9e2981

View File

@ -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']: