Skip to content

Commit

Permalink
Fix #144 (exception when using --dump with host-to-IP aliases)
Browse files Browse the repository at this point in the history
Now `vpn-slice --dump` output will show host-to-IP aliases in a sane form:

    $ vpn-slice --dump foo.host.com=bar.host.com=1.2.3.4 ipv6.host.com=f00f::1234
    ...
    Complete set of host aliases to add /etc/hosts entries for:
      1.2.3.4 -> foo.host.com, bar.host.com
      f00f::1234 -> ipv6.host.com
    ...
  • Loading branch information
dlenski committed Nov 29, 2023
1 parent 28ace48 commit 3ebb562
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vpn_slice/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ def main(args=None, environ=os.environ):
print(' ' + '\n '.join(map(str, args.exc_subnets)))
if args.aliases:
print('Complete set of host aliases to add /etc/hosts entries for:', file=stderr)
print(' ' + '\n '.join(args.aliases))
print(' ' + '\n '.join('%s -> %s' % (ip, ', '.join(a)) for (ip, a) in args.aliases.items()))
if args.hosts:
print('Complete set of host names to include in VPN routes after DNS lookup%s:' % (' (and add /etc/hosts entries for)' if args.host_names else ''), file=stderr)
print(' ' + '\n '.join(args.hosts))
Expand Down

0 comments on commit 3ebb562

Please sign in to comment.