

def delete(self, req, id):
    context = req.environ['nova.context']
    self.compute_api.ensure_default_security_group(context)
    try:
        id = int(id)
        rule = db.security_group_rule_get(context, id)
    except ValueError:
        msg = _('Rule id is not integer')
        return exc.HTTPBadRequest(explanation=msg)
    except exception.NotFound as exp:
        msg = (_('Rule (%s) not found') % id)
        return exc.HTTPNotFound(explanation=msg)
    group_id = rule.parent_group_id
    self.compute_api.ensure_default_security_group(context)
    security_group = db.security_group_get(context, group_id)
    msg = _('Revoke security group ingress %s')
    LOG.audit(msg, security_group['name'], context=context)
    db.security_group_rule_destroy(context, rule['id'])
    self.compute_api.trigger_security_group_rules_refresh(context, security_group_id=security_group['id'])
    return exc.HTTPAccepted()

dataset/ETHPy150Open nii-cloud/dodai-compute/nova/api/openstack/contrib/security_groups.py SecurityGroupRulesController.delete/original