From 63e5d5dcc43b2f12d64fe9cee99db755a6ad334d Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Mon, 19 Jan 2015 10:54:22 -0600 Subject: [PATCH] Use rax_to_dict and make sure to return the volume details after deletion --- lib/ansible/modules/cloud/rackspace/rax_cbs.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/cloud/rackspace/rax_cbs.py b/lib/ansible/modules/cloud/rackspace/rax_cbs.py index a1b6ce46a6e..b72d757c71f 100644 --- a/lib/ansible/modules/cloud/rackspace/rax_cbs.py +++ b/lib/ansible/modules/cloud/rackspace/rax_cbs.py @@ -145,10 +145,7 @@ def cloud_block_storage(module, state, name, description, meta, size, attempts=attempts) volume.get() - for key, value in vars(volume).iteritems(): - if (isinstance(value, NON_CALLABLES) and - not key.startswith('_')): - instance[key] = value + instance = rax_to_dict(volume) result = dict(changed=changed, volume=instance) @@ -164,6 +161,7 @@ def cloud_block_storage(module, state, name, description, meta, size, elif state == 'absent': if volume: + instance = rax_to_dict(volume) try: volume.delete() changed = True