Exemplo n.º 1
0
 def getbroker(self):
     """
     Get the amqp broker for this plugin.  Each plugin can
     connect to a different broker.
     @return: The broker if configured.
     @rtype: L{Broker}
     """
     cfg = self.cfg()
     main = Config()
     broker = Broker(self.geturl())
     broker.cacert = \
         nvl(cfg.messaging.cacert,
         nvl(main.messaging.cacert))
     broker.clientcert = \
         nvl(cfg.messaging.clientcert,
         nvl(main.messaging.clientcert))
     log.info('broker (qpid) configured: %s', broker)
     return broker
Exemplo n.º 2
0
 def start(cls):
     url = config.get('messaging', 'url')
     log.info('Using URL: %s', url)
     # broker configuration
     broker = Broker(url)
     broker.cacert = config.get('messaging', 'cacert')
     broker.clientcert = config.get('messaging', 'clientcert')
     log.info('AMQP broker configured')
     # watchdog
     journal = Journal('/var/lib/pulp/journal/watchdog')
     cls.watchdog = WatchDog(url=url, journal=journal)
     cls.watchdog.start()
     log.info('AMQP watchdog started')
     # heartbeat
     cls.heartbeat_listener = HeartbeatListener(url)
     cls.heartbeat_listener.start()
     log.info('AMQP heartbeat listener started')
     # asynchronous reply
     cls.reply_handler = ReplyHandler(url)
     cls.reply_handler.start(cls.watchdog)
     log.info('AMQP reply handler started')
Exemplo n.º 3
0
 def start(cls):
     url = config.get('messaging', 'url')
     log.info('Using URL: %s', url)
     # broker configuration
     broker = Broker(url)
     broker.cacert = config.get('messaging', 'cacert')
     broker.clientcert = config.get('messaging', 'clientcert')
     log.info('AMQP broker configured')
     # watchdog
     journal = Journal('/var/lib/pulp/journal/watchdog')
     cls.watchdog = WatchDog(url=url, journal=journal)
     cls.watchdog.start()
     log.info('AMQP watchdog started')
     # heartbeat
     cls.heartbeat_listener = HeartbeatListener(url)
     cls.heartbeat_listener.start()
     log.info('AMQP heartbeat listener started')
     # asynchronous reply
     cls.reply_handler = ReplyHandler(url)
     cls.reply_handler.start(cls.watchdog)
     log.info('AMQP reply handler started')
Exemplo n.º 4
0
 def init():
     url = config.get('messaging', 'url')
     broker = Broker(url)
     broker.cacert = config.get('messaging', 'cacert')
     broker.clientcert = config.get('messaging', 'clientcert')
     log.info('AMQP broker configured: %s', broker)
Exemplo n.º 5
0
 def __init(cls, url):
     b = Broker(url)
     b.cacert = nvl(cfg.broker.cacert)
     b.clientcert = nvl(cfg.broker.clientcert)