def get_id(self):
     """
     Return the id of the service.
     :rtype : str the string representing the service
     """
     text_id = "%s|%s|%s" % (self.name,
                             self._opts["expected"],
                             " ".join(self.get_cmd("start")), )
     return md5_hash(text_id.encode()).hexdigest()
Exemple #2
0
 def _maybe_bind(self, queue_name, exchange, routing_key=""):
     """ May be bind a queue to an exchange. """
     bind_id = md5_hash(queue_name + exchange + routing_key).hexdigest()
     if bind_id in self._bind:
         return
     LOGGER.debug(
         "binding incoming queue: queue=%s, exchange=%s, routing_key=%s" %
         (queue_name, exchange, routing_key))
     self._channel.queue_bind(queue=queue_name,
                              exchange=exchange,
                              routing_key=routing_key)
     self._bind[bind_id] = 1
Exemple #3
0
 def _maybe_bind(self, queue_name, exchange, routing_key=""):
     """ May be bind a queue to an exchange. """
     bind_id = md5_hash(queue_name + exchange + routing_key).hexdigest()
     if bind_id in self._bind:
         return
     LOGGER.debug(
         "binding incoming queue: queue=%s, exchange=%s, routing_key=%s" %
         (queue_name, exchange, routing_key))
     self._channel.queue_bind(queue=queue_name,
                              exchange=exchange,
                              routing_key=routing_key)
     self._bind[bind_id] = 1
 def get_id(self):
     """
     Return the id of the supervisor.
     """
     return md5_hash(self.name.encode()).hexdigest()