1515# limitations under the License.
1616#
1717
18- from oslo_log import helpers as log_helpers
19- from oslo_log import log as logging
18+ from f5lbaasdriver .v2 .bigip import constants_v2 as constants
2019
21- from neutron .api .v2 import attributes
2220from neutron .common import rpc as neutron_rpc
2321from neutron .db import agents_db
2422from neutron .extensions import portbindings
2523from neutron .plugins .common import constants as plugin_constants
24+
2625from neutron_lbaas .db .loadbalancer import models
2726from neutron_lbaas .services .loadbalancer import constants as nlb_constant
27+
2828from neutron_lib import constants as neutron_const
2929
30- from f5lbaasdriver .v2 .bigip import constants_v2 as constants
30+ from oslo_log import helpers as log_helpers
31+ from oslo_log import log as logging
32+
3133
3234LOG = logging .getLogger (__name__ )
3335
@@ -510,7 +512,7 @@ def create_port_on_subnet(self, context, subnet_id=None,
510512 subnet_id
511513 )
512514 if not mac_address :
513- mac_address = attributes .ATTR_NOT_SPECIFIED
515+ mac_address = neutron_const .ATTR_NOT_SPECIFIED
514516 fixed_ip = {'subnet_id' : subnet ['id' ]}
515517 if fixed_address_count > 1 :
516518 fixed_ips = []
@@ -540,6 +542,10 @@ def create_port_on_subnet(self, context, subnet_id=None,
540542 port_data [portbindings .VNIC_TYPE ] = vnic_type
541543 port_data [portbindings .PROFILE ] = binding_profile
542544
545+ if ('binding:capabilities' in
546+ portbindings .EXTENDED_NEUTRON_CONST_2_0 ['ports' ]):
547+ port_data ['binding:capabilities' ] = {
548+ 'port_filter' : False }
543549 port = self .driver .plugin .db ._core_plugin .create_port (
544550 context , {'port' : port_data })
545551 # Because ML2 marks ports DOWN by default on creation
@@ -678,7 +684,7 @@ def create_port_on_network(self, context, network_id=None,
678684 )
679685
680686 if not mac_address :
681- mac_address = attributes .ATTR_NOT_SPECIFIED
687+ mac_address = neutron_const .ATTR_NOT_SPECIFIED
682688 if not host :
683689 host = ''
684690 if not name :
@@ -692,7 +698,7 @@ def create_port_on_network(self, context, network_id=None,
692698 'admin_state_up' : True ,
693699 'device_owner' : 'network:f5lbaasv2' ,
694700 'status' : neutron_const .PORT_STATUS_ACTIVE ,
695- 'fixed_ips' : attributes .ATTR_NOT_SPECIFIED
701+ 'fixed_ips' : neutron_const .ATTR_NOT_SPECIFIED
696702 }
697703 if device_id :
698704 port_data ['device_id' ] = device_id
0 commit comments