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:
parent
8f3c435b27
commit
40c6191da6
1 changed files with 3 additions and 3 deletions
|
@ -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 peek_result['state'] == 'absent':
|
||||
if peek_result.get('state') == 'absent':
|
||||
diff['before'] = ''
|
||||
elif peek_result['appears_binary']:
|
||||
elif peek_result.get('appears_binary'):
|
||||
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
|
||||
else:
|
||||
display.debug("Slurping the file %s" % source)
|
||||
|
|
Loading…
Reference in a new issue