diff --git a/vmware_nsx/neutron/plugins/vmware/nsxlib/v3/__init__.py b/vmware_nsx/neutron/plugins/vmware/nsxlib/v3/__init__.py index bf4d5c1a11..96fc2db70a 100644 --- a/vmware_nsx/neutron/plugins/vmware/nsxlib/v3/__init__.py +++ b/vmware_nsx/neutron/plugins/vmware/nsxlib/v3/__init__.py @@ -91,7 +91,8 @@ def delete_logical_switch(lswitch_id): def create_logical_port(lswitch_id, vif_uuid, attachment_type=nsx_constants.ATTACHMENT_VIF, - admin_state=nsx_constants.ADMIN_STATE_UP): + admin_state=nsx_constants.ADMIN_STATE_UP, + name=None): controller, user, password = _get_controller_endpoint() url = controller + "/api/v1/logical-ports" @@ -100,6 +101,8 @@ def create_logical_port(lswitch_id, 'attachment': {'attachment_type': attachment_type, 'id': vif_uuid}, 'admin_state': admin_state} + if name: + body['display_name'] = name result = requests.post(url, auth=auth.HTTPBasicAuth(user, password), verify=False, headers=headers, diff --git a/vmware_nsx/neutron/plugins/vmware/plugins/nsx_v3_plugin.py b/vmware_nsx/neutron/plugins/vmware/plugins/nsx_v3_plugin.py index e223e657d7..531afe7ee2 100644 --- a/vmware_nsx/neutron/plugins/vmware/plugins/nsx_v3_plugin.py +++ b/vmware_nsx/neutron/plugins/vmware/plugins/nsx_v3_plugin.py @@ -111,9 +111,9 @@ class NsxV3Plugin(db_base_plugin_v2.NeutronDbPluginV2, nsxlib.delete_logical_switch(network_id) return ret_val - def update_network(self, context, id, network): + def update_network(self, context, network_id, network): # TODO(arosen) - call to backend - return super(NsxV3Plugin, self).update_network(context, id, + return super(NsxV3Plugin, self).update_network(context, network_id, network) def create_port(self, context, port): @@ -124,7 +124,7 @@ class NsxV3Plugin(db_base_plugin_v2.NeutronDbPluginV2, port_id = uuidutils.generate_uuid() result = nsxlib.create_logical_port( lswitch_id=port['port']['network_id'], - vif_uuid=port_id) + vif_uuid=port_id, name=port['port']['name']) port['port']['id'] = port_id # TODO(salv-orlando): Undo logical switch creation on failure with context.session.begin():