Пример #1
0
 def send_verified_notification(self, exist, connection, exchange,
                                routing_keys=None):
     body = exist.raw.json
     json_body = json.loads(body)
     json_body[1]['event_type'] = 'compute.instance.exists.verified.old'
     json_body[1]['original_message_id'] = json_body[1]['message_id']
     json_body[1]['message_id'] = str(uuid.uuid4())
     if routing_keys is None:
         message_service.send_notification(
             json_body[1], json_body[0], connection, exchange)
     else:
         for key in routing_keys:
             message_service.send_notification(
                 json_body[1], key, connection, exchange)
Пример #2
0
 def send_verified_notification(self, exist, connection, exchange, routing_keys=None):
     # NOTE (apmelton)
     # The exist we're provided from the callback may have cached queries
     # from before it was serialized. We don't want to use them as
     # they could have been lost somewhere in the process forking.
     # So, grab a new InstanceExists object from the database and use it.
     body = models.ImageExists.objects.get(id=exist.id).raw.json
     json_body = json.loads(body)
     json_body[1]["event_type"] = self.config.glance_event_type()
     json_body[1]["original_message_id"] = json_body[1]["message_id"]
     json_body[1]["message_id"] = str(uuid.uuid4())
     if routing_keys is None:
         message_service.send_notification(json_body[1], json_body[0], connection, exchange)
     else:
         for key in routing_keys:
             message_service.send_notification(json_body[1], key, connection, exchange)
Пример #3
0
 def send_verified_notification(self, exist, connection, exchange,
                                routing_keys=None):
     # NOTE (apmelton)
     # The exist we're provided from the callback may have cached queries
     # from before it was serialized. We don't want to use them as
     # they could have been lost somewhere in the process forking.
     # So, grab a new InstanceExists object from the database and use it.
     body = models.InstanceExists.objects.get(id=exist.id).raw.json
     json_body = json.loads(body)
     json_body[1]['event_type'] = self.config.nova_event_type()
     json_body[1]['original_message_id'] = json_body[1]['message_id']
     json_body[1]['message_id'] = str(uuid.uuid4())
     if routing_keys is None:
         message_service.send_notification(
             json_body[1], json_body[0], connection, exchange)
     else:
         for key in routing_keys:
             message_service.send_notification(
                 json_body[1], key, connection, exchange)
Пример #4
0
 def send_notif(notif):
     msg.send_notification(notif, rabbit_config['routing_key'],
                           conn, exchange)
Пример #5
0
 def send_notif(notif):
     msg.send_notification(notif, rabbit_config['routing_key'],
                           conn, exchange)