Skip to content
Snippets Groups Projects
Commit 1babba75 authored by tikitavi's avatar tikitavi Committed by Kubernetes Prow Robot
Browse files

adapt inventory script to python 2.7 version (#4407)

parent ed18a105
No related branches found
No related tags found
No related merge requests found
......@@ -197,8 +197,14 @@ class KubesprayInventory(object):
reworked_hosts = []
def ips(start_address, end_address):
start = int(ip_address(start_address).packed.hex(), 16)
end = int(ip_address(end_address).packed.hex(), 16)
try:
# Python 3.x
start = int(ip_address(start_address))
end = int(ip_address(end_address))
except:
# Python 2.7
start = int(ip_address(unicode(start_address)))
end = int(ip_address(unicode(end_address)))
return [ip_address(ip).exploded for ip in range(start, end+1)]
for host in hosts:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment