mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-02-16 18:32:03 +01:00
fix flake8 issues, clarify comment
This commit is contained in:
parent
036c49e412
commit
64d5c77a71
@ -48,10 +48,11 @@ def main():
|
||||
return hostwatch.hw_main(opt.subnets, opt.auto_hosts)
|
||||
else:
|
||||
# parse_subnetports() is used to create a list of includes
|
||||
# and excludes. It returns a list of one or more items for
|
||||
# each subnet. It returns a list since "-x example.com"
|
||||
# might find that example.com has multiple IP addresses. Here,
|
||||
# we flatten these lists.
|
||||
# and excludes. It is called once for each parameter and
|
||||
# returns a list of one or more items for each subnet (it
|
||||
# can return more than one item when a hostname in the
|
||||
# parameter resolves to multiple IP addresses. Here, we
|
||||
# flatten these lists.
|
||||
includes = [item for sublist in opt.subnets+opt.subnets_file
|
||||
for item in sublist]
|
||||
excludes = [item for sublist in opt.exclude for item in sublist]
|
||||
|
@ -94,7 +94,6 @@ def parse_subnetport(s):
|
||||
rv.append((family, addr[0], cidr_to_use,
|
||||
int(fport or 0), int(lport or fport or 0)))
|
||||
|
||||
|
||||
return rv
|
||||
|
||||
|
||||
@ -124,7 +123,8 @@ def parse_ipport(s):
|
||||
raise Fatal('Unable to resolve address: %s' % host)
|
||||
|
||||
if len(addrinfo) > 1:
|
||||
print("WARNING: Host %s has more than one IP, only using one of them." % host)
|
||||
print("WARNING: Host %s has more than one IP, only using one of them."
|
||||
% host)
|
||||
|
||||
family, _, _, _, addr = min(addrinfo)
|
||||
# Note: addr contains (ip, port)
|
||||
|
Loading…
Reference in New Issue
Block a user