pluginmanager.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:son-mano-framework 作者: sonata-nfv 项目源码 文件源码
def _on_deregister(self, ch, method, properties, message):
        """
        Event method that is called when a de-registration request is received.
        Removes the given plugin from the internal data model.
        :param properties: request properties
        :param message: request body (contains UUID to identify plugin)
        :return: response message
        """
        message = json.loads(str(message))

        try:
            p = model.Plugin.objects.get(uuid=message.get("uuid"))
            p.delete()
        except DoesNotExist:
            LOG.debug("Couldn't find plugin with UUID %r in DB" % pid)

        LOG.info("DE-REGISTERED: %r" % message.get("uuid"))
        # broadcast a plugin status update to the other plugin
        self.send_plugin_status_update()
        # return result
        response = {
            "status": "OK"
        }
        return json.dumps(response)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号