From cda4b6dad1dd375e1fce6e44ba0c1f23350951fb Mon Sep 17 00:00:00 2001 From: ABond Date: Tue, 12 Jun 2018 03:18:55 -0400 Subject: [PATCH] Digital Ocean Block Storage Bug (#41431) Fix added for Digital Ocean Volumes API change causing Ansible to recieve an unexpected value in the response. Signed-off-by: ABond Signed-off-by: Abhijeet Kasurde (cherry picked from commit 4efe53edd5fe0f643cadf8a5bfda7c4833faeb07) --- changelogs/fragments/digital_ocean_block_storage_fix.yaml | 3 +++ .../modules/cloud/digital_ocean/digital_ocean_block_storage.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/digital_ocean_block_storage_fix.yaml diff --git a/changelogs/fragments/digital_ocean_block_storage_fix.yaml b/changelogs/fragments/digital_ocean_block_storage_fix.yaml new file mode 100644 index 00000000000..e4b2f4392f5 --- /dev/null +++ b/changelogs/fragments/digital_ocean_block_storage_fix.yaml @@ -0,0 +1,3 @@ +--- +bugfixes: +- Fix added for Digital Ocean Volumes API change causing Ansible to recieve an unexpected value in the response. (https://github.com/ansible/ansible/pull/41431) diff --git a/lib/ansible/modules/cloud/digital_ocean/digital_ocean_block_storage.py b/lib/ansible/modules/cloud/digital_ocean/digital_ocean_block_storage.py index ead6ef194b1..bcff70a11b5 100644 --- a/lib/ansible/modules/cloud/digital_ocean/digital_ocean_block_storage.py +++ b/lib/ansible/modules/cloud/digital_ocean/digital_ocean_block_storage.py @@ -199,7 +199,7 @@ class DOBlockStorage(object): json = response.json if status == 201: self.module.exit_json(changed=True, id=json['volume']['id']) - elif status == 409 and json['id'] == 'already_exists': + elif status == 409 and json['id'] == 'conflict': self.module.exit_json(changed=False) else: raise DOBlockStorageException(json['message'])