

def handle(self, request, context):
    try:
        data = {
            'ikepolicy': {
                'name': context['name'],
                'description': context['description'],
                'auth_algorithm': context['auth_algorithm'],
                'encryption_algorithm': context['encryption_algorithm'],
                'ike_version': context['ike_version'],
                'lifetime': {
                    'units': context['lifetime_units'],
                    'value': context['lifetime_value'],
                },
                'pfs': context['pfs'],
                'phase1_negotiation_mode': context['phase1_negotiation_mode'],
            },
        }
        ikepolicy = api.vpn.ikepolicy_update(request, context['ikepolicy_id'], **data)
        msg = (_('IKE Policy %s was successfully updated.') % context['name'])
        LOG.debug(msg)
        messages.success(request, msg)
        return ikepolicy
    except Exception as e:
        msg = (_('Failed to update IKE Policy %s') % context['name'])
        LOG.info(('%s: %s' % (msg, e)))
        redirect = reverse(self.failure_url)
        exceptions.handle(request, msg, redirect=redirect)

dataset/ETHPy150Open Havate/havate-openstack/proto-build/gui/horizon/Horizon_GUI/openstack_dashboard/dashboards/project/vpn/forms.py UpdateIKEPolicy.handle/original