Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Commit

Permalink
Fixing test condition for classic ELB VPCId
Browse files Browse the repository at this point in the history
  • Loading branch information
TheM0ng00se committed Nov 21, 2018
1 parent 9672eea commit a5a67ee
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions cinq_collector_aws/region.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ def update_vpcs(self):
location=self.region,
properties=properties,
tags=tags
)
)
db.session.commit()

# Removal of VPCs
Expand Down Expand Up @@ -548,6 +548,9 @@ def update_elbs(self):
tags = {}
else:
tags = {}

vpc_data = (data['VPCId'] if ('VPCId' in data and data['VPCId']) else 'no vpc')

properties = {
'lb_name': data['LoadBalancerName'],
'dns_name': data['DNSName'],
Expand All @@ -557,7 +560,7 @@ def update_elbs(self):
'num_instances': len(
[instance['InstanceId'] for instance in data['Instances']]
),
'vpc_id': (data['VPCId'] if (data['VPCId'] and 'VPCId' in data) else 'no vpc'),
'vpc_id': vpc_data,
'state': 'not_reported'
}
if 'CanonicalHostedZoneName' in data:
Expand Down Expand Up @@ -596,10 +599,10 @@ def update_elbs(self):
for elb_identifier in elb_keys_from_db - elb_keys_from_api:
db.session.delete(elbs_from_db[elb_identifier].resource)
self.log.info('Deleted ELB {}/{}/{}'.format(
self.account.account_name,
self.region,
elb_identifier
)
self.account.account_name,
self.region,
elb_identifier
)
)
db.session.commit()

Expand Down

0 comments on commit a5a67ee

Please sign in to comment.