Esempio n. 1
0
 def notify_exc_info(self, context, serialized_notification,
                     message, exception):
     notification = SerializableNotification.deserialize(
         context, serialized_notification)
     LOG.error(_("Guest exception on request %(req)s:\n%(exc)s")
               % {'req': notification.request_id, 'exc': exception})
     notification.notify_exc_info(message, exception)
Esempio n. 2
0
 def notify_exc_info(self, context, serialized_notification,
                     message, exception):
     notification = SerializableNotification.deserialize(
         context, serialized_notification)
     LOG.error(_("Guest exception on request %(req)s:\n%(exc)s")
               % {'req': notification.request_id, 'exc': exception})
     notification.notify_exc_info(message, exception)
Esempio n. 3
0
 def from_dict(cls, values):
     n_values = values.pop('trove_notification', None)
     context = cls(**values)
     if n_values:
         context.notification = SerializableNotification.deserialize(
             context, n_values)
     return context
Esempio n. 4
0
 def from_dict(cls, values):
     n_values = values.pop('trove_notification', None)
     context = cls(**values)
     if n_values:
         context.notification = SerializableNotification.deserialize(
             context, n_values)
     return context
Esempio n. 5
0
 def notify_exc_info(self, context, serialized_notification,
                     message, exception):
     notification = SerializableNotification.deserialize(
         context, serialized_notification)
     LOG.error("Guest exception on request %s:\n%s"
               % (notification.request_id, exception))
     notification.notify_exc_info(message, exception)
Esempio n. 6
0
 def from_dict(cls, values):
     n_values = values.pop('trove_notification', None)
     values = cls._remove_incompatible_context_args(values)
     context = cls(**values)
     if n_values:
         context.notification = SerializableNotification.deserialize(
             context, n_values)
     return context
Esempio n. 7
0
 def from_dict(cls, values):
     n_values = values.pop('trove_notification', None)
     values = cls._remove_incompatible_context_args(values)
     context = cls(**values)
     if n_values:
         context.notification = SerializableNotification.deserialize(
             context, n_values)
     return context
Esempio n. 8
0
 def notify_end(self, **notification_args):
     LOG.debug("Making async call to cast end notification")
     cctxt = self.client.prepare(version=self.version_cap)
     context = self.context
     serialized = SerializableNotification.serialize(context,
                                                     context.notification)
     cctxt.cast(self.context, "notify_end",
                serialized_notification=serialized,
                notification_args=notification_args)
Esempio n. 9
0
 def notify_exc_info(self, message, exception):
     LOG.debug("Making async call to cast error notification")
     cctxt = self.client.prepare(version=self.version_cap)
     context = self.context
     serialized = SerializableNotification.serialize(context,
                                                     context.notification)
     cctxt.cast(self.context, "notify_exc_info",
                serialized_notification=serialized,
                message=message, exception=exception)
Esempio n. 10
0
 def to_dict(self):
     parent_dict = super(TroveContext, self).to_dict()
     parent_dict.update({'limit': self.limit,
                         'marker': self.marker,
                         'service_catalog': self.service_catalog
                         })
     if hasattr(self, 'notification'):
         serialized = SerializableNotification.serialize(self,
                                                         self.notification)
         parent_dict['trove_notification'] = serialized
     return parent_dict
Esempio n. 11
0
 def to_dict(self):
     parent_dict = super(TroveContext, self).to_dict()
     parent_dict.update({'limit': self.limit,
                         'marker': self.marker,
                         'service_catalog': self.service_catalog
                         })
     if hasattr(self, 'notification'):
         serialized = SerializableNotification.serialize(self,
                                                         self.notification)
         parent_dict['trove_notification'] = serialized
     return parent_dict
Esempio n. 12
0
    def from_dict(cls, values):
        n_values = values.pop('trove_notification', None)
        ctx = super(TroveContext, cls).from_dict(
            values,
            limit=values.get('limit'),
            marker=values.get('marker'),
            service_catalog=values.get('service_catalog'))

        if n_values:
            ctx.notification = SerializableNotification.deserialize(
                ctx, n_values)
        return ctx
Esempio n. 13
0
 def notify_exc_info(self, message, exception):
     LOG.debug("Making async call to cast error notification")
     version = self.API_BASE_VERSION
     cctxt = self.client.prepare(version=version)
     context = self.context
     serialized = SerializableNotification.serialize(
         context, context.notification)
     serialized.update({'instance_id': CONF.guest_id})
     cctxt.cast(self.context,
                "notify_exc_info",
                serialized_notification=serialized,
                message=message,
                exception=exception)
Esempio n. 14
0
    def to_dict(self):
        parent_dict = super(TroveContext, self).to_dict()
        # DAS - Remove the roles attribute that was introduced in
        # a later version of oslo.context. This is to facilitate
        # a 1.7.x guest working with 1.8 controller (Paypal migration)
        parent_dict.pop('roles', None)

        parent_dict.update({
            'limit': self.limit,
            'marker': self.marker,
            'service_catalog': self.service_catalog
        })
        if hasattr(self, 'notification'):
            serialized = SerializableNotification.serialize(
                self, self.notification)
            parent_dict['trove_notification'] = serialized
        return parent_dict
Esempio n. 15
0
 def notify_exc_info(self, context, serialized_notification, message,
                     exception):
     notification = SerializableNotification.deserialize(
         context, serialized_notification)
     notification.notify_exc_info(message, exception)
Esempio n. 16
0
 def notify_end(self, context, serialized_notification, notification_args):
     notification = SerializableNotification.deserialize(
         context, serialized_notification)
     notification.notify_end(**notification_args)
Esempio n. 17
0
 def notify_exc_info(self, context, serialized_notification,
                     message, exception):
     notification = SerializableNotification.deserialize(
         context, serialized_notification)
     notification.notify_exc_info(message, exception)
Esempio n. 18
0
 def notify_end(self, context, serialized_notification, notification_args):
     notification = SerializableNotification.deserialize(
         context, serialized_notification)
     notification.notify_end(**notification_args)