

def handle(self, request, context):
    try:
        data = {
            'ipsec_site_connection': {
                'name': context['name'],
                'description': context['description'],
                'peer_address': context['peer_address'],
                'peer_id': context['peer_id'],
                'peer_cidrs': context['peer_cidrs'].replace(' ', '').split(','),
                'psk': context['psk'],
                'mtu': context['mtu'],
                'dpd': {
                    'action': context['dpd_action'],
                    'interval': context['dpd_interval'],
                    'timeout': context['dpd_timeout'],
                },
                'initiator': context['initiator'],
                'admin_state_up': context['admin_state_up'],
            },
        }
        ipsecsiteconnection = api.vpn.ipsecsiteconnection_update(request, context['ipsecsiteconnection_id'], **data)
        msg = (_('IPSec Site Connection %s was successfully updated.') % context['name'])
        LOG.debug(msg)
        messages.success(request, msg)
        return ipsecsiteconnection
    except Exception as e:
        msg = (_('Failed to update IPSec Site Connection %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 UpdateIPSecSiteConnection.handle/original