summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bachman <tbachman@yahoo.com>2020-09-23 14:34:36 +0000
committerRodolfo Alonso Hernandez <ralonsoh@redhat.com>2023-03-21 18:05:37 +0100
commited96c94d41dea3e238e32156c56d2642c94eb68b (patch)
treeed6b34dd73a4944905ac9dfc00ca076c31aa6b14
parent933724652a91bac54fe8dc8e7ca042ba13aa8d09 (diff)
downloadneutron-ed96c94d41dea3e238e32156c56d2642c94eb68b.tar.gz
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 68625686a40b3eb75502c8116f23d2297e288ca1 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 f759915ab0c30ebba6d3d970943b596b5c245599)
-rw-r--r--neutron/db/db_base_plugin_v2.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/neutron/db/db_base_plugin_v2.py b/neutron/db/db_base_plugin_v2.py
index 2356f62623..af8740ec9b 100644
--- a/neutron/db/db_base_plugin_v2.py
+++ b/neutron/db/db_base_plugin_v2.py
@@ -405,7 +405,7 @@ class NeutronDbPluginV2(db_base_plugin_common.DbBasePluginCommon,
args = {'tenant_id': n['tenant_id'],
'id': n.get('id') or uuidutils.generate_uuid(),
'name': n['name'],
- 'mtu': n.get('mtu', constants.DEFAULT_NETWORK_MTU),
+ 'mtu': n.get('mtu', 0),
'admin_state_up': n['admin_state_up'],
'status': n.get('status', constants.NET_STATUS_ACTIVE),
'description': n.get('description')}