@wsgi.response(200)
    def update(self, req, body, gid, securitygroup_id):

        def _validate(body, gid, securitygroup_id):
            if not self.is_valid_body(body, 'securitygroup'):
                msg = _("Invalid request body")
                raise exception.InvalidInput(reason=msg)

            self._uuid_check(gid, securitygroup_id)
            values = body["securitygroup"]
            is_default = values.get("is_default")
            if is_default is not None:
                try:
                    is_default = strutils.bool_from_string(
                        is_default, strict=True)
                except __HOLE__:
                    msg = _("is_default must be a boolean")
                    raise exception.InvalidInput(reason=msg)
            else:
                msg = _("SecurityGroup is_default is required")
                raise exception.InvalidInput(reason=msg)

            valid_values = {}
            valid_values["is_default"] = is_default
            return valid_values

        try:
            values = _validate(body, gid, securitygroup_id)
            context = req.environ['rack.context']
            securitygroup = db.securitygroup_update(
                context, gid, securitygroup_id, values)
        except exception.InvalidInput as exc:
            raise webob.exc.HTTPBadRequest(explanation=exc.format_message())
        except exception.NotFound as exc:
            raise webob.exc.HTTPNotFound(explanation=exc.format_message())

        return self._view_builder.update(securitygroup)
dataset/ETHPy150Open openstack/rack/rack/api/v1/securitygroups.py/Controller.update