From b1aeec6d76c3a2840f88985247fd3e9bff723ce9 Mon Sep 17 00:00:00 2001 From: Adit Sarfaty Date: Thu, 15 Feb 2018 11:38:42 +0200 Subject: [PATCH] VPN DPD timeout changes The NSX implementation changed the DPD timeout limits and field name Change-Id: Ic4ad0484685e4aeb7054bcfa52551beea8fe0cd9 --- vmware_nsxlib/tests/unit/v3/test_vpn_ipsec.py | 4 ++-- vmware_nsxlib/v3/vpn_ipsec.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vmware_nsxlib/tests/unit/v3/test_vpn_ipsec.py b/vmware_nsxlib/tests/unit/v3/test_vpn_ipsec.py index 9797bbc7..6ea4ae76 100644 --- a/vmware_nsxlib/tests/unit/v3/test_vpn_ipsec.py +++ b/vmware_nsxlib/tests/unit/v3/test_vpn_ipsec.py @@ -117,7 +117,7 @@ class TestIPSecDpdProfile(test_resources.BaseTestResource): data=jsonutils.dumps({ 'display_name': name, 'description': description, - 'timeout': timeout, + 'dpd_probe_interval': timeout, 'enabled': enabled }, sort_keys=True), headers=self.default_headers()) @@ -128,7 +128,7 @@ class TestIPSecDpdProfile(test_resources.BaseTestResource): uuid = test_constants.FAKE_DPD_ID mocked_resource = self.get_mocked_resource(response=fake_dpd) mocked_resource.update(uuid, timeout=new_timeout) - fake_dpd['timeout'] = new_timeout + fake_dpd['dpd_probe_interval'] = new_timeout test_client.assert_json_call( 'put', mocked_resource, 'https://1.2.3.4/api/v1/%s/%s' % (mocked_resource.uri_segment, diff --git a/vmware_nsxlib/v3/vpn_ipsec.py b/vmware_nsxlib/v3/vpn_ipsec.py index 5736a437..118fce64 100644 --- a/vmware_nsxlib/v3/vpn_ipsec.py +++ b/vmware_nsxlib/v3/vpn_ipsec.py @@ -79,7 +79,7 @@ class DpdProfileActionTypes(object): class DpdProfileTimeoutLimits(object): """Supported DPD timeout range""" DPD_TIMEOUT_MIN = 3 - DPD_TIMEOUT_MAX = 3600 + DPD_TIMEOUT_MAX = 360 class IkeSALifetimeLimits(object): @@ -206,7 +206,7 @@ class IPSecDpdProfile(utils.NsxLibApiBase): if description: body['description'] = description if timeout: - body['timeout'] = timeout + body['dpd_probe_interval'] = timeout # Boolean parameters if enabled is not None: body['enabled'] = enabled @@ -219,7 +219,7 @@ class IPSecDpdProfile(utils.NsxLibApiBase): body = self.get(profile_id) if timeout: - body['timeout'] = timeout + body['dpd_probe_interval'] = timeout if enabled is not None: body['enabled'] = enabled if tags is not None: