libs.tools.resolve_identifier: add support for named networks
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
969b45d9f7
commit
1742f51778
3 changed files with 707 additions and 8 deletions
|
@ -22,14 +22,13 @@ def resolve_identifier(repo, identifier):
|
|||
return {'ipv4': {ip}, 'ipv6': set()}
|
||||
else:
|
||||
return {'ipv4': set(), 'ipv6': {ip}}
|
||||
except Exception as e:
|
||||
io.stderr('{x} {t} Exception while resolving "{i}": {e}'.format(
|
||||
x=red('✘'),
|
||||
t=bold('libs.tools.resolve_identifier'),
|
||||
i=identifier,
|
||||
e=str(e),
|
||||
))
|
||||
raise
|
||||
except ValueError:
|
||||
try:
|
||||
return repo.libs.firewall.named_networks[identifier]
|
||||
except KeyError:
|
||||
raise BundleError(
|
||||
f'libs.tools.resolve_identifier(): Could not resolve {identifier}'
|
||||
)
|
||||
|
||||
found_ips = set()
|
||||
for node in nodes:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue