def printable_ssh_host_key(ssh_host_key):
    try:
        keygen = subprocess.Popen(["ssh-keygen", "-lf", "/dev/stdin"], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
        if USING_PYTHON2:
            (stdout, stderr) = keygen.communicate(ssh_host_key)
        else:
            (stdout, stderr) = keygen.communicate(ssh_host_key.encode())
    except:
        return ssh_host_key.strip()
    else:
        if not USING_PYTHON2:
            stdout =  stdout.decode()
        return stdout.replace(" no comment", "").strip()