Merge "Cisco N1kv plugin to send subtype on network profile creation"
This commit is contained in:
commit
e87f003522
|
@ -256,6 +256,8 @@ class Client(object):
|
||||||
'id': network_profile['id'],
|
'id': network_profile['id'],
|
||||||
'logicalNetwork': logical_network_name,
|
'logicalNetwork': logical_network_name,
|
||||||
'tenantId': tenant_id}
|
'tenantId': tenant_id}
|
||||||
|
if network_profile['segment_type'] == c_const.NETWORK_TYPE_OVERLAY:
|
||||||
|
body['subType'] = network_profile['sub_type']
|
||||||
return self._post(
|
return self._post(
|
||||||
self.network_segment_pool_path % network_profile['id'],
|
self.network_segment_pool_path % network_profile['id'],
|
||||||
body=body)
|
body=body)
|
||||||
|
|
|
@ -272,6 +272,13 @@ class TestN1kvNetworkProfiles(N1kvPluginTestCase):
|
||||||
res = net_p_req.get_response(self.ext_api)
|
res = net_p_req.get_response(self.ext_api)
|
||||||
self.assertEqual(res.status_int, 201)
|
self.assertEqual(res.status_int, 201)
|
||||||
|
|
||||||
|
def test_create_network_profile_overlay_missing_subtype(self):
|
||||||
|
data = self._prepare_net_profile_data(c_const.NETWORK_TYPE_OVERLAY)
|
||||||
|
data['network_profile'].pop('sub_type')
|
||||||
|
net_p_req = self.new_create_request('network_profiles', data)
|
||||||
|
res = net_p_req.get_response(self.ext_api)
|
||||||
|
self.assertEqual(res.status_int, 400)
|
||||||
|
|
||||||
def test_create_network_profile_trunk(self):
|
def test_create_network_profile_trunk(self):
|
||||||
data = self._prepare_net_profile_data(c_const.NETWORK_TYPE_TRUNK)
|
data = self._prepare_net_profile_data(c_const.NETWORK_TYPE_TRUNK)
|
||||||
net_p_req = self.new_create_request('network_profiles', data)
|
net_p_req = self.new_create_request('network_profiles', data)
|
||||||
|
|
Loading…
Reference in New Issue