Update keyscan for python3 compat

Use six.text_type since unicode() doesn't exist for python3.

Change-Id: I3628759c46f44429471aa394dee5056e191e4a05
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2017-05-25 22:09:00 -04:00
parent 969a838d83
commit 93b516d978
1 changed files with 2 additions and 1 deletions

View File

@ -20,6 +20,7 @@ import base64
import errno
import ipaddress
import time
import six
import socket
import logging
@ -53,7 +54,7 @@ def keyscan(ip, timeout=60):
if 'fake' in ip:
return ['ssh-rsa FAKEKEY']
if ipaddress.ip_address(unicode(ip)).version < 6:
if ipaddress.ip_address(six.text_type(ip)).version < 6:
family = socket.AF_INET
sockaddr = (ip, 22)
else: