Example #1
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)
Example #2
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)
Example #3
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
Example #4
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
Example #5
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)
Example #6
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