Make result=true if Docker volume already exists

In other states the result is always returned as `True` if no change is
required, whether `test=True` is set or not.

Fixes #42076
This commit is contained in:
Andrew Bulford 2017-07-03 16:08:16 +01:00
parent ca4e619edb
commit 8d549685a7

View file

@ -2442,7 +2442,7 @@ def volume_present(name, driver=None, driver_opts=None, force=False):
ret['result'] = result
return ret
ret['result'] = None if __opts__['test'] else True
ret['result'] = True
ret['comment'] = 'Volume \'{0}\' already exists.'.format(name)
return ret