Skip to content

Commit fec0286

Browse files
tbachmanralonsoh
authored andcommitted
Fix default value for MTUs, when not provided
When networks are created using REST APIs, if the MTU isn't specified in the request, then a default value of 0 is used. Some use cases, such as the auto-allocated-topology workflow, call the plugin directly to create networks, bypassing the layer that inserts this default value. Commit 6862568 introduced a different default value at the DB layer, defined by a constant in neutron-lib. If the maximum MTU size has been configured lower than this constant, then the user receives an exception, even though they didn't provide a value for MTU. This patch changes the default value used in the DB layer, so that it's consistent with the workflow seen via REST APIs. Change-Id: Ica21e891cd2559942abb0ab2b12132e7f6cdd835 Closes-Bug: #1896933 (cherry picked from commit f759915)
1 parent 5588065 commit fec0286

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

neutron/db/db_base_plugin_v2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ def create_network_db(self, context, network):
407407
args = {'tenant_id': project_id,
408408
'id': n.get('id') or uuidutils.generate_uuid(),
409409
'name': n['name'],
410-
'mtu': n.get('mtu', constants.DEFAULT_NETWORK_MTU),
410+
'mtu': n.get('mtu', 0),
411411
'admin_state_up': n['admin_state_up'],
412412
'status': n.get('status', constants.NET_STATUS_ACTIVE),
413413
'description': n.get('description')}

0 commit comments

Comments
 (0)