mirror of
https://github.com/codingo/Interlace.git
synced 2025-12-17 06:44:23 +01:00
Accept hostname targets that do not contain a period.
This fixes issue #123, which was due to a misinterpretation of the
line
`if host.split(".")[0][0].isalpha() or host.split(".")[-1][-1].isalpha():`
(see commit 8d46d14731, L156). Because of
how Python's str.split() works, a hostname that does not contain a
period when .split(".") results in a single-item list, so this
expression evaluates to True. However, this also means that the
.split()s had no effect: the line was equivalent to
`if host[0].isalpha() or host[-1].isalpha()`.
This commit is contained in:
@@ -187,10 +187,7 @@ class InputHelper(object):
|
|||||||
for target_spec in target_specs:
|
for target_spec in target_specs:
|
||||||
if (
|
if (
|
||||||
target_spec.startswith(".") or
|
target_spec.startswith(".") or
|
||||||
(
|
(target_spec[0].isalpha() or target_spec[-1].isalpha()) or
|
||||||
(target_spec[0].isalpha() or target_spec[-1].isalpha())
|
|
||||||
and "." in target_spec
|
|
||||||
) or
|
|
||||||
(nocidr and "/" in target_spec)
|
(nocidr and "/" in target_spec)
|
||||||
):
|
):
|
||||||
str_targets.add(target_spec)
|
str_targets.add(target_spec)
|
||||||
|
|||||||
Reference in New Issue
Block a user