[cloud aws_s3] Enforce required parameters for the various aws_s3 modes (#36767)

[cloud aws_s3] Most modes require `object` parameter, and this is easy to
get wrong (e.g. through confusion with the `dest` parameter). As
it's as easy to enforce, let's do that.
This commit is contained in:
Will Thames 2018-03-03 07:33:04 +10:00 committed by Sloane Hertel
parent 836d7a42a4
commit aa1e491244

View file

@ -636,7 +636,10 @@ def main():
module = AnsibleModule(
argument_spec=argument_spec,
supports_check_mode=True,
required_if=[('mode', 'put', ('src',))],
required_if=[['mode', 'put', ['src', 'object']],
['mode', 'get', ['dest', 'object']],
['mode', 'getstr', ['object']],
['mode', 'geturl', ['object']]],
)
if module._name == 's3':