diff options
author | Thomas Bachman <tbachman@yahoo.com> | 2020-09-23 14:34:36 +0000 |
---|---|---|
committer | Rodolfo Alonso Hernandez <ralonsoh@redhat.com> | 2023-03-21 18:04:56 +0100 |
commit | d0d8702e896d23d50cfd94b5b929d98ee089ed77 (patch) | |
tree | 642dcbc20914928a27bac769e145f2766dcb9494 | |
parent | 67b4ff3850c90bc73f5536f8a14d803144bbb700 (diff) | |
download | neutron-d0d8702e896d23d50cfd94b5b929d98ee089ed77.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.py | 2 |
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 9f4d33a1ce..4247d0fe1c 100644 --- a/neutron/db/db_base_plugin_v2.py +++ b/neutron/db/db_base_plugin_v2.py @@ -409,7 +409,7 @@ class NeutronDbPluginV2(db_base_plugin_common.DbBasePluginCommon, args = {'tenant_id': project_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')} |