Development
This commit is contained in:
parent
c0230f25d8
commit
67186ee6b7
1 changed files with 7 additions and 1 deletions
|
|
@ -305,8 +305,14 @@ def _config_datasource(name):
|
||||||
row['use_blocklists'] = json.dumps([
|
row['use_blocklists'] = json.dumps([
|
||||||
{'n': bl, 'd': bl_desc.get(bl, bl)} for bl in v.get('use_blocklists', [])
|
{'n': bl, 'd': bl_desc.get(bl, bl)} for bl in v.get('use_blocklists', [])
|
||||||
])
|
])
|
||||||
|
_prefix = v.get('subnet_mask', 24)
|
||||||
|
_n_octets = 1 if _prefix >= 24 else 2 if _prefix >= 16 else 3 if _prefix >= 8 else 4
|
||||||
row['server_identity_ips'] = json.dumps([
|
row['server_identity_ips'] = json.dumps([
|
||||||
{'n': s['ip'], 'd': s['ip'], 'short': '.' + s['ip'].rsplit('.', 1)[-1], 'mini': '.' + s['ip'].rsplit('.', 1)[-1]}
|
{
|
||||||
|
'n': s['ip'], 'd': s['ip'],
|
||||||
|
'short': '.' + '.'.join(s['ip'].split('.')[-_n_octets:]),
|
||||||
|
'mini': '.' + '.'.join(s['ip'].split('.')[-_n_octets:]),
|
||||||
|
}
|
||||||
for s in v.get('server_identities', []) if s.get('ip')
|
for s in v.get('server_identities', []) if s.get('ip')
|
||||||
])
|
])
|
||||||
row['server_identity_descriptions'] = json.dumps([
|
row['server_identity_descriptions'] = json.dumps([
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue