ec2 network_interfaces fix

This commit is contained in:
joseph.gimenez@peoplematter.com 2015-06-25 19:19:48 -04:00
parent f65e663353
commit 7a393df080

View File

@ -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(