Revision dac67c0a db/db_controller.py

b/db/db_controller.py
29 29

  
30 30
from threading import Thread, Event, currentThread
31 31
from synnefo.db.models import VirtualMachine
32
from synnefo.settings import GANETI_ZMQ_PUBLISHER
32
from synnefo.settings import GANETI_MASTER_IP, GANETI_0MQD_PUB_PORT
33 33
from synnefo.logic import utils, backend
34 34

  
35 35
class StoppableThread(Thread):
......
41 41
    """
42 42

  
43 43
    def __init__(self, *args, **kwargs):
44
        super(StoppableThread, self).__init__(*args, **kwargs)
44
        Thread.__init__(self, *args, **kwargs)
45 45
        self._stop = Event()
46 46

  
47 47
    def stop(self):
......
52 52

  
53 53

  
54 54
def zmq_sub_thread(subscriber):
55
    logging.error("Entering 0mq to wait for message on SUB socket.")
55 56
    while True:
56 57
        logging.debug("Entering 0mq to wait for message on SUB socket.")
57 58
        data = subscriber.recv()
......
99 100
    # a hopefully unique identity for this 0mq peer.
100 101
    # Reusing zmq.IDENTITY for two distinct peers triggers this 0mq bug:
101 102
    # https://github.com/zeromq/zeromq2/issues/30
103
    GANETI_ZMQ_PUBLISHER = "tcp://%s:%d" % (GANETI_MASTER_IP, int(GANETI_0MQD_PUB_PORT))
102 104
    subscriber.setsockopt(zmq.IDENTITY, platform.node() + getpass.getuser() + "snf-db-controller")
103 105
    subscriber.setsockopt(zmq.SUBSCRIBE, "")
104 106
    subscriber.connect(GANETI_ZMQ_PUBLISHER)

Also available in: Unified diff