neutron_sfc_dummy_api.py 文件源码

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

项目:son-emu 作者: sonata-nfv 项目源码 文件源码
def put(self, flow_classifier_id):
        logging.debug("API CALL: %s PUT" % str(self.__class__.__name__))

        try:
            request_dict = json.loads(request.data).get("flow_classifier")
            flow_classifier = self.api.compute.find_flow_classifier_by_name_or_id(flow_classifier_id)
            if "name" in request_dict:
                flow_classifier.name = request_dict["name"]
            if "description" in request_dict:
                flow_classifier.description = request_dict["description"]

            resp = {
                "flow_classifier": flow_classifier.create_dict(self.api.compute)
            }
            return Response(json.dumps(resp), status=200, mimetype='application/json')
        except Exception as ex:
            logging.exception("Neutron SFC: %s Exception." % str(self.__class__.__name__))
            return Response(ex.message, status=500, mimetype='application/json')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号