Fix VPN local endpoint structure

NSX request format changed.

Change-Id: I084c41bdb22eb681571c97060ba065181032fc97
This commit is contained in:
Adit Sarfaty 2018-01-17 09:27:30 +02:00
parent cf9d4c0f27
commit 17617d1e30
3 changed files with 5 additions and 4 deletions

View File

@ -481,7 +481,8 @@ FAKE_LEP = {
"id": FAKE_LEP_ID,
"display_name": "XXX",
"local_id": "1.1.1.1",
"ipsec_vpn_service_id": "aca38a11-981b-46d8-9e2c-9bedc0d96794",
"ipsec_vpn_service_id": {"target_id":
"aca38a11-981b-46d8-9e2c-9bedc0d96794"},
"local_address": "1.1.1.1",
"trust_ca_ids": [],
"trust_crl_ids": [],

View File

@ -224,7 +224,7 @@ class TestLocalEndpoint(test_resources.BaseTestResource):
'local_address': local_address,
'local_id': local_id,
'description': description,
'ipsec_vpn_service_id': ipsec_vpn_service_id
'ipsec_vpn_service_id': {'target_id': ipsec_vpn_service_id}
}, sort_keys=True),
headers=self.default_headers())

View File

@ -316,7 +316,7 @@ class LocalEndpoint(utils.NsxLibApiBase):
# mandatory parameters
body = {'display_name': name,
'local_address': local_address,
'ipsec_vpn_service_id': ipsec_vpn_service_id}
'ipsec_vpn_service_id': {'target_id': ipsec_vpn_service_id}}
# optional parameters
if description:
body['description'] = description
@ -346,7 +346,7 @@ class LocalEndpoint(utils.NsxLibApiBase):
if local_address:
body['local_address'] = local_address
if ipsec_vpn_service_id:
body['ipsec_vpn_service_id'] = ipsec_vpn_service_id
body['ipsec_vpn_service_id'] = {'target_id': ipsec_vpn_service_id}
if local_id:
body['local_id'] = local_id
if certificate_id: