From 7a393df0803bfe62600af15ba2690ba98c17079a Mon Sep 17 00:00:00 2001 From: "joseph.gimenez@peoplematter.com" Date: Thu, 25 Jun 2015 19:19:48 -0400 Subject: [PATCH] ec2 network_interfaces fix --- salt/cloud/clouds/ec2.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/salt/cloud/clouds/ec2.py b/salt/cloud/clouds/ec2.py index aa10d496c2..a73acfefb5 100644 --- a/salt/cloud/clouds/ec2.py +++ b/salt/cloud/clouds/ec2.py @@ -1152,10 +1152,17 @@ def _create_eni_if_necessary(interface): for subnet_query_result in subnet_query: if 'item' in subnet_query_result: - for subnet in subnet_query_result['item']: - if subnet['subnetId'] == interface['SubnetId']: - found = True - break + if type(subnet_query_result['item']) is dict: + for key, value in subnet_query_result['item'].iteritems(): + if key == "subnetId": + if value == interface['SubnetId']: + found = True + break + else: + for subnet in subnet_query_result['item']: + if subnet['subnetId'] == interface['SubnetId']: + found = True + break if not found: raise SaltCloudConfigError(