Merge pull request #27180 from tankywoo/file-copy-result-true-in-test

file copy ret result True if no change in test mode
This commit is contained in:
Justin Findlay 2015-09-17 00:27:43 -06:00
commit d988aa2145

View File

@ -3866,11 +3866,16 @@ def copy(
) )
if __opts__['test']: if __opts__['test']:
ret['comment'] = 'File "{0}" is set to be copied to "{1}"'.format( if changed:
source, ret['comment'] = 'File "{0}" is set to be copied to "{1}"'.format(
name source,
) name
ret['result'] = None )
ret['result'] = None
else:
ret['comment'] = ('The target file "{0}" exists and will not be '
'overwritten'.format(name))
ret['result'] = True
return ret return ret
if not changed: if not changed: