S3 object parameter and bucket deletion exclusive (#21830)
Fixes ansible#21796 Prevent users from deleting buckets rather than objects by making object parameter and mode=delobj mutually exclusive in task. https://github.com/ansible/ansible/issues/21796
This commit is contained in:
parent
2c0ad28056
commit
c6849a3464
1 changed files with 4 additions and 0 deletions
|
@ -511,6 +511,10 @@ def main():
|
|||
if module.params.get('object'):
|
||||
obj = module.params['object']
|
||||
|
||||
# Bucket deletion does not require obj. Prevents ambiguity with delobj.
|
||||
if obj and mode == "delete":
|
||||
module.fail_json(msg='Parameter obj cannot be used with mode=delete')
|
||||
|
||||
# allow eucarc environment variables to be used if ansible vars aren't set
|
||||
if not s3_url and 'S3_URL' in os.environ:
|
||||
s3_url = os.environ['S3_URL']
|
||||
|
|
Loading…
Reference in a new issue