fix raw scan
This commit is contained in:
@@ -175,19 +175,24 @@ def process_country(country, networks_count, force=False):
|
|||||||
|
|
||||||
if app_type.startswith('raw-'):
|
if app_type.startswith('raw-'):
|
||||||
format_type = app_type.split('-')[1]
|
format_type = app_type.split('-')[1]
|
||||||
|
|
||||||
|
if aggregate:
|
||||||
|
nets_out = ConfigGenerator._aggregate_networks(networks)
|
||||||
|
else:
|
||||||
|
nets_out = sorted(set(networks))
|
||||||
|
|
||||||
if format_type == 'cidr_txt':
|
if format_type == 'cidr_txt':
|
||||||
config_text = '\n'.join(networks)
|
config_text = '\n'.join(nets_out)
|
||||||
elif format_type == 'newline_txt':
|
elif format_type == 'newline_txt':
|
||||||
config_text = '\n'.join(networks)
|
config_text = '\n'.join(nets_out)
|
||||||
elif format_type == 'json':
|
elif format_type == 'json':
|
||||||
config_text = json.dumps({
|
config_text = json.dumps({
|
||||||
'country': country,
|
'country': country,
|
||||||
'networks': networks,
|
'networks': nets_out,
|
||||||
'count': len(networks)
|
'count': len(nets_out)
|
||||||
}, indent=2)
|
}, indent=2)
|
||||||
elif format_type == 'csv':
|
elif format_type == 'csv':
|
||||||
config_text = 'network\n' + '\n'.join(networks)
|
config_text = 'network\n' + '\n'.join(nets_out)
|
||||||
else:
|
else:
|
||||||
errors += 1
|
errors += 1
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user