Merge "NSX|V3: pass 'nsx-logical-switch-id' as part of the port details"
This commit is contained in:
commit
9c62ef023b
@ -134,12 +134,6 @@ class NsxV3Plugin(addr_pair_db.AllowedAddressPairsMixin,
|
|||||||
nsx_client._set_default_api_cluster(self._api_cluster)
|
nsx_client._set_default_api_cluster(self._api_cluster)
|
||||||
|
|
||||||
self.cfg_group = 'nsx_v3' # group name for nsx_v3 section in nsx.ini
|
self.cfg_group = 'nsx_v3' # group name for nsx_v3 section in nsx.ini
|
||||||
self.base_binding_dict = {
|
|
||||||
pbin.VIF_TYPE: pbin.VIF_TYPE_OVS,
|
|
||||||
pbin.VIF_DETAILS: {
|
|
||||||
# TODO(rkukura): Replace with new VIF security details
|
|
||||||
pbin.CAP_PORT_FILTER:
|
|
||||||
'security-group' in self.supported_extension_aliases}}
|
|
||||||
self.tier0_groups_dict = {}
|
self.tier0_groups_dict = {}
|
||||||
self._setup_dhcp()
|
self._setup_dhcp()
|
||||||
self._start_rpc_notifiers()
|
self._start_rpc_notifiers()
|
||||||
@ -176,6 +170,23 @@ class NsxV3Plugin(addr_pair_db.AllowedAddressPairsMixin,
|
|||||||
raise nsx_exc.NsxPluginException(msg)
|
raise nsx_exc.NsxPluginException(msg)
|
||||||
self._unsubscribe_callback_events()
|
self._unsubscribe_callback_events()
|
||||||
|
|
||||||
|
def _extend_port_dict_binding(self, port_res, port_db):
|
||||||
|
port_res[pbin.VIF_TYPE] = pbin.VIF_TYPE_OVS
|
||||||
|
port_res[pbin.VNIC_TYPE] = pbin.VNIC_NORMAL
|
||||||
|
port_res[pbin.VIF_DETAILS] = {
|
||||||
|
# TODO(rkukura): Replace with new VIF security details
|
||||||
|
pbin.CAP_PORT_FILTER:
|
||||||
|
'security-group' in self.supported_extension_aliases,
|
||||||
|
# TODO(garyk): at the moment the neutron network UUID
|
||||||
|
# is the same as the NSX logical switch ID. When nova
|
||||||
|
# supports the code below we can switch to pass the NSX
|
||||||
|
# logical switch ID
|
||||||
|
'nsx-logical-switch-id': port_res['network_id']}
|
||||||
|
|
||||||
|
# Register the hook to extend the port data
|
||||||
|
db_base_plugin_v2.NeutronDbPluginV2.register_dict_extend_funcs(
|
||||||
|
attributes.PORTS, ['_extend_port_dict_binding'])
|
||||||
|
|
||||||
def _unsubscribe_callback_events(self):
|
def _unsubscribe_callback_events(self):
|
||||||
# l3_db explicitly subscribes to the port delete callback. This
|
# l3_db explicitly subscribes to the port delete callback. This
|
||||||
# callback is unsubscribed here since l3 APIs are handled by
|
# callback is unsubscribed here since l3 APIs are handled by
|
||||||
@ -827,11 +838,6 @@ class NsxV3Plugin(addr_pair_db.AllowedAddressPairsMixin,
|
|||||||
self._process_port_create_extra_dhcp_opts(
|
self._process_port_create_extra_dhcp_opts(
|
||||||
context, port_data, dhcp_opts)
|
context, port_data, dhcp_opts)
|
||||||
|
|
||||||
# For some reason the port bindings DB mixin does not handle
|
|
||||||
# the VNIC_TYPE attribute, which is required by nova for
|
|
||||||
# setting up VIFs.
|
|
||||||
port_data[pbin.VNIC_TYPE] = pbin.VNIC_NORMAL
|
|
||||||
|
|
||||||
sgids = self._get_security_groups_on_port(context, port)
|
sgids = self._get_security_groups_on_port(context, port)
|
||||||
self._process_port_create_security_group(
|
self._process_port_create_security_group(
|
||||||
context, port_data, sgids)
|
context, port_data, sgids)
|
||||||
@ -1686,10 +1692,6 @@ class NsxV3Plugin(addr_pair_db.AllowedAddressPairsMixin,
|
|||||||
super(NsxV3Plugin, self).disassociate_floatingips(
|
super(NsxV3Plugin, self).disassociate_floatingips(
|
||||||
context, port_id, do_notify=False)
|
context, port_id, do_notify=False)
|
||||||
|
|
||||||
def extend_port_dict_binding(self, port_res, port_db):
|
|
||||||
super(NsxV3Plugin, self).extend_port_dict_binding(port_res, port_db)
|
|
||||||
port_res[pbin.VNIC_TYPE] = pbin.VNIC_NORMAL
|
|
||||||
|
|
||||||
def create_security_group(self, context, security_group, default_sg=False):
|
def create_security_group(self, context, security_group, default_sg=False):
|
||||||
secgroup = security_group['security_group']
|
secgroup = security_group['security_group']
|
||||||
secgroup['id'] = uuidutils.generate_uuid()
|
secgroup['id'] = uuidutils.generate_uuid()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user