Skip to content

Commit 7034a09

Browse files
committed
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 8d46d14, 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()`.
1 parent 9ba669d commit 7034a09

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Interlace/lib/core/input.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,7 @@ def parse_and_group_target_specs(target_specs, nocidr):
187187
for target_spec in target_specs:
188188
if (
189189
target_spec.startswith(".") or
190-
(
191-
(target_spec[0].isalpha() or target_spec[-1].isalpha())
192-
and "." in target_spec
193-
) or
190+
(target_spec[0].isalpha() or target_spec[-1].isalpha()) or
194191
(nocidr and "/" in target_spec)
195192
):
196193
str_targets.add(target_spec)

0 commit comments

Comments
 (0)