示例#1
0
文件: __init__.py 项目: nickxiao/vdsm
    def emit(self, **kwargs):
        self._add_notify_time(kwargs)
        notification = json.dumps({'jsonrpc': '2.0',
                                   'method': self._event_id,
                                   'params': kwargs})

        self.log.debug("Sending event %s", notification)
        self._cb(notification)
示例#2
0
文件: __init__.py 项目: zofuthan/vdsm
    def encode(self):
        res = {
            'jsonrpc': '2.0',
            'method': self.method,
            'params': self.params,
            'id': self.id
        }

        return json.dumps(res, 'utf-8')
示例#3
0
    def emit(self, **kwargs):
        self._add_notify_time(kwargs)
        notification = json.dumps({
            'jsonrpc': '2.0',
            'method': self._event_id,
            'params': kwargs
        })

        self.log.debug("Sending event %s", notification)
        self._cb(notification)
示例#4
0
 def encode(self):
     res = self.toDict()
     return json.dumps(res, 'utf-8')
示例#5
0
文件: __init__.py 项目: nickxiao/vdsm
 def encode(self):
     res = self.toDict()
     return json.dumps(res, 'utf-8')