file copy ret result True if no change in test mode

This commit is contained in:
Tanky Woo 2015-09-17 13:29:56 +08:00 committed by rallytime
parent a02d043309
commit 327d343fef

View file

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