Skip to content

Commit

Permalink
Correcting code indentation to OpenSearch inventory (attempt x)
Browse files Browse the repository at this point in the history
  • Loading branch information
esc1144 committed Oct 19, 2023
1 parent fa71312 commit 80dd4ad
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions data-collection/deploy/module-inventory.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,18 +193,18 @@ Resources:
for region in regions:
client = session.client(service, region_name=region)
try:
domain_names = [name.get('DomainName') for name in client.list_domain_names().get('DomainNames', [])]
domains = client.describe_domains(DomainNames=domain_names)['DomainStatusList']
for domain in domains:
yield {
'region': region,
'accountid': account_id,
'DomainName': domain['DomainName'],
'DomainId': domain['DomainId'],
'EngineVersion': domain['EngineVersion'],
'InstanceType': domain['ClusterConfig']['InstanceType'],
'InstanceCount': domain['ClusterConfig']['InstanceCount'],
}
domain_names = [name.get('DomainName') for name in client.list_domain_names().get('DomainNames', [])]
for domain in domain_names:
domains = client.describe_domain(DomainName=domain)['DomainStatus']
yield {
'region': region,
'accountid': account_id,
'DomainName': domains['DomainName'],
'DomainId': domains['DomainId'],
'EngineVersion': domains['EngineVersion'],
'InstanceType': domains['ClusterConfig']['InstanceType'],
'InstanceCount': domains['ClusterConfig']['InstanceCount'],
}
except Exception as exc: #pylint: disable=broad-exception-caught
logger.info(f'scan {service}/{account_id}/{region}: {exc}')
Expand Down

0 comments on commit 80dd4ad

Please sign in to comment.