

def handle(self, request, context):
    rule_id = e.initial['rule_id']
    name_or_id = (context.get('name') or rule_id)
    if (context['protocol'] == 'ANY'):
        context['protocol'] = None
    for f in ['source_ip_address', 'destination_ip_address', 'source_port', 'destination_port']:
        if (not context[f]):
            context[f] = None
    try:
        rule = api.fwaas.rule_update(request, rule_id, **context)
        msg = (_('Rule %s was successfully updated.') % name_or_id)
        LOG.debug(msg)
        messages.success(request, msg)
        return rule
    except Exception as e:
        msg = (_('Failed to update rule %(name)s: %(reason)s') % {
            'name': name_or_id,
            'reason': e,
        })
        LOG.error(msg)
        redirect = reverse(self.failure_url)
        exceptions.handle(request, msg, redirect=redirect)

dataset/ETHPy150Open openstack/horizon/openstack_dashboard/dashboards/project/firewalls/forms.py UpdateRule.handle/VarMisuse@16/19 `self`->`e`