Commit 73d8fd57 authored by Christopher R. Gabriel's avatar Christopher R. Gabriel
Browse files

close #196

parent eb887fda
pyoctofuss (1.6.5-1) unstable; urgency=medium
* fix #196 - python3 porting
-- Christopher R. Gabriel <cgabriel@truelite.it> Wed, 22 Feb 2017 12:09:14 +0100
pyoctofuss (1.6.4-1) unstable; urgency=low
* fix #195 - missing python3-six dep
......
# coding: utf-8
from __future__ import (absolute_import, print_function, division, unicode_literals)
import xmlrpc.client
import sys, time
import sys
import socket
def list_cluster(server_url):
......@@ -15,7 +15,7 @@ def list_cluster(server_url):
servers.append(ns)
servers.sort()
return servers
def find_broadcast():
import os
addresses = []
......@@ -27,14 +27,14 @@ def find_broadcast():
return addresses
def discover_server(timeout=5):
PORT = 13400
s= socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
PORT = 13400
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind(('', PORT+1))
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
baddrs = find_broadcast()
servers = []
for baddr in baddrs:
data = "client-request"
data = b"client-request"
s.sendto(data, (baddr, PORT))
# wait 5 seconds for the answer
s.settimeout(timeout)
......
......@@ -4,7 +4,7 @@ from distutils.core import setup
setup(
name='pyoctofuss',
version="1.6.4",
version="1.6.5",
description='Octofuss common library',
author=['Enrico Zini','Christopher Gabriel'],
author_email=['enrico@truelite.it', 'cgabriel@truelite.it'],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment