1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

win_template: fix key errors when --diff is used

This commit is contained in:
Rene Moser 2017-01-05 00:04:34 +01:00 committed by Brian Coca
parent 8f3c435b27
commit 40c6191da6

View file

@ -810,11 +810,11 @@ class ActionBase(with_metaclass(ABCMeta, object)):
if not peek_result.get('failed', False) or peek_result.get('rc', 0) == 0: if not peek_result.get('failed', False) or peek_result.get('rc', 0) == 0:
if peek_result['state'] == 'absent': if peek_result.get('state') == 'absent':
diff['before'] = '' diff['before'] = ''
elif peek_result['appears_binary']: elif peek_result.get('appears_binary'):
diff['dst_binary'] = 1 diff['dst_binary'] = 1
elif C.MAX_FILE_SIZE_FOR_DIFF > 0 and peek_result['size'] > C.MAX_FILE_SIZE_FOR_DIFF: elif peek_result.get('size') and C.MAX_FILE_SIZE_FOR_DIFF > 0 and peek_result['size'] > C.MAX_FILE_SIZE_FOR_DIFF:
diff['dst_larger'] = C.MAX_FILE_SIZE_FOR_DIFF diff['dst_larger'] = C.MAX_FILE_SIZE_FOR_DIFF
else: else:
display.debug("Slurping the file %s" % source) display.debug("Slurping the file %s" % source)