Skip to content

Commit 10075fd

Browse files
author
kush1093
committed
Ocata Development LBaaSv2 driver issue with ML2 portbinding extension
Issues: Fixes #894 Problem: Ocata Development LBaaSv2 driver issue with ML2 portbinding extension Analysis: As neutron.extensions.portbindings.EXTENDED_NEUTRON_CONST_2_0 dicti -onar is absent in Ocata, i commented out the lines wherever the attribute "binding:capabilities" was encountered in the code. Tests: Created and ran the test "f5lbaasdriver/v2/bigip/test/test_plugin_rpc.py"
1 parent 46b78e6 commit 10075fd

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

f5lbaasdriver/v2/bigip/test/test_plugin_rpc.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
1+
# Copyright 2016 F5 Networks Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
import mock
216
import pytest
317

418
import neutron.api.v2.attributes
519
from neutron_lib import constants as neutron_const
620

7-
import f5lbaasdriver.v2.bigip.plugin_rpc
21+
import f5lbaasdriver.v2.bigip.plugin_rpc
822

923

1024
@pytest.fixture
@@ -19,21 +33,25 @@ def fully_mocked_target(init):
1933
@pytest.fixture
2034
def neutron_attributes(request):
2135
hold_attributes = neutron.api.v2.attributes
36+
2237
def finalizer():
2338
neutron.api.v2.attributes = hold_attributes
2439
request.addfinalizer(finalizer)
2540
neutron.api.v2.attributes = mock.Mock()
2641
return neutron.api.v2.attributes
2742

43+
2844
@pytest.fixture
2945
def neutron_extensions(request):
3046
hold_extensions = neutron.extensions
47+
3148
def finalizer():
3249
neutron.extensions = hold_extensions
3350
request.addfinalizer(finalizer)
3451
neutron.extensions = mock.Mock()
3552
return neutron.extensions
3653

54+
3755
def test_create_port_on_subnet(fully_mocked_target, neutron_attributes,
3856
neutron_extensions):
3957
portbindings = neutron_extensions.portbindings
@@ -51,7 +69,7 @@ def test_create_port_on_subnet(fully_mocked_target, neutron_attributes,
5169
setattr(portbindings, attr, attr)
5270
fake_args['vnic_type'] = portbindings.VNIC_NORMAL
5371
# fake validation data...
54-
subnet = {'id': 'subnet_id', 'tenant_id': 'tenant_id',
72+
subnet = {'id': 'subnet_id', 'tenant_id': 'tenant_id',
5573
'network_id': 'network_id'}
5674
port = {'id': 'id'}
5775
device_ips = [{'subnet_id': subnet['id']}]

0 commit comments

Comments
 (0)