check elb type in compare_subnets for elbv2 (#50203)

* Add check for elb type to fix difference between NLB and ALB AZ return structure

Fixes #49558

* Fix spacing for pep8 (hopefully) compliancE

* use empty array default instead of loadbalancer type detection

hat tip briantist

* spacing is probably important.
pull/51414/head
Tad Merchant 7 years ago committed by Will Thames
parent 98db75e7e7
commit 71ef69d51f

@ -169,7 +169,7 @@ class ElasticLoadBalancerV2(object):
# on the load balancer
for subnet in self.elb['AvailabilityZones']:
this_mapping = {'SubnetId': subnet['SubnetId']}
for address in subnet['LoadBalancerAddresses']:
for address in subnet.get('LoadBalancerAddresses', []):
if 'AllocationId' in address:
this_mapping['AllocationId'] = address['AllocationId']
break

Loading…
Cancel
Save