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:19:04 +01:00
parent a0b537c8b6
commit 2e1dc95500

View file

@ -187,7 +187,7 @@ def 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