From e02bd8fa0d06ba83d71c1528a33cf87ea795fa64 Mon Sep 17 00:00:00 2001 From: Shad Nygren Date: Wed, 31 Dec 2014 23:14:04 +0000 Subject: [PATCH] Fix TypeError: string indices must be integers, not str in ec2.py create_attach_volumes() --- salt/cloud/clouds/ec2.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/salt/cloud/clouds/ec2.py b/salt/cloud/clouds/ec2.py index 20d3c77db2..1750d25c76 100644 --- a/salt/cloud/clouds/ec2.py +++ b/salt/cloud/clouds/ec2.py @@ -2337,9 +2337,8 @@ def create_attach_volumes(name, kwargs, call=None, wait_to_finish=True): if 'volume_id' not in volume_dict: created_volume = create_volume(volume_dict, call='function', wait_to_finish=wait_to_finish) created = True - for item in created_volume: - if 'volumeId' in item: - volume_dict['volume_id'] = item['volumeId'] + if 'volumeId' in created_volume: + volume_dict['volume_id'] = created_volume['volumeId'] attach = attach_volume( name,