From 4ea6bded61e7e9029ebc89fd98bd92851024f878 Mon Sep 17 00:00:00 2001 From: David Shrewsbury Date: Thu, 23 Apr 2015 10:37:43 -0400 Subject: [PATCH] Update os_volume for latest shade The shade volume API was updated to return a dict rather than the object as returned by cinder. --- lib/ansible/modules/cloud/openstack/os_volume.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/cloud/openstack/os_volume.py b/lib/ansible/modules/cloud/openstack/os_volume.py index 932d6578e5c..8cc47363d26 100644 --- a/lib/ansible/modules/cloud/openstack/os_volume.py +++ b/lib/ansible/modules/cloud/openstack/os_volume.py @@ -88,7 +88,7 @@ EXAMPLES = ''' def _present_volume(module, cloud): if cloud.volume_exists(module.params['display_name']): v = cloud.get_volume(module.params['display_name']) - module.exit_json(changed=False, id=v.id, info=v._info) + module.exit_json(changed=False, id=v['id']) volume_args = dict( size=module.params['size'], @@ -105,11 +105,10 @@ def _present_volume(module, cloud): volume = cloud.create_volume( wait=module.params['wait'], timeout=module.params['timeout'], **volume_args) - module.exit_json(changed=True, id=volume.id, info=volume._info) + module.exit_json(changed=True, id=volume['id']) def _absent_volume(module, cloud): - try: cloud.delete_volume( name_or_id=module.params['display_name'],