@exception.wrap_pecan_controller_exception
    @pecan.expose()
    def post(self):
        """Create a new plan."""
        if not pecan.request.body or 1 < len(pecan.request.body):
            raise exception.BadRequest(reason="No data.")

        handler = plan_handler.PlanHandler(pecan.request.security_context)

        if (pecan.request.content_type is not None and
                'yaml' in pecan.request.content_type):
            data = init_yml_plan_by_version()
            created_plan = yamlutils.dump(yaml_content(handler.create(
                data.as_dict(objects.registry.Plan))))
        else:
            data = init_json_plan_by_version()
            plan_wsme = plan.Plan.from_db_model(handler.create(
                data.as_dict(objects.registry.Plan)), pecan.request.host_url)
            created_plan = wsme_json.encode_result(plan_wsme, plan.Plan)

        pecan.response.status = 201
        return created_plan
dataset/ETHPy150Open openstack/solum/solum/api/controllers/v1/plan.py/PlansController.post/swapped operands of `<`