Allow hosts with hyphen in name (#6529)

This commit is contained in:
Florian Ruynat 2020-08-18 09:53:30 +02:00 committed by GitHub
parent d8a749fd27
commit 73b2683697
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -238,7 +238,7 @@ class KubesprayInventory(object):
return [ip_address(ip).exploded for ip in range(start, end + 1)]
for host in hosts:
if '-' in host and not host.startswith('-'):
if '-' in host and not (host.startswith('-') or host[0].isalpha()):
start, end = host.strip().split('-')
try:
reworked_hosts.extend(ips(start, end))