Inconsistent enable_snat management

Bug #1384146 reported by Cedric Brandily
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Cedric Brandily

Bug Description

Neutron reset enable_snat on router-gateway-clear but not on router-gateway-set which implies inconsistent behavior:

# pub1, pub2 are external networks and router1 is a router

(neutron) router-gateway-set router1 pub1 --disable-snat
Set gateway for router router
(neutron) router-show router1 -c external_gateway_info
+-----------------------+------------------------------------------------------------------------------+
| Field | Value |
+-----------------------+------------------------------------------------------------------------------+
| external_gateway_info | {"network_id": "1682e4f4-7dc4-4ed0-bd10-e526ab2f6f81", "enable_snat": false} |
+-----------------------+------------------------------------------------------------------------------+
(neutron) router-gateway-clear router
Removed gateway from router router
(neutron) router-gateway-set router pub2
Set gateway for router router
(neutron) router-show router1 -c external_gateway_info
+-----------------------+------------------------------------------------------------------------------+
| Field | Value |
+-----------------------+------------------------------------------------------------------------------+
| external_gateway_info | {"network_id": "a32bcb44-165a-4de8-a8db-35f6ff8f2712", "enable_snat": true} |
+-----------------------+------------------------------------------------------------------------------+

==> enable_snat == False lost during router-gateway-clear

(neutron) router-gateway-set router1 pub1 --disable-snat
Set gateway for router router
(neutron) router-show router1 -c external_gateway_info
+-----------------------+------------------------------------------------------------------------------+
| Field | Value |
+-----------------------+------------------------------------------------------------------------------+
| external_gateway_info | {"network_id": "1682e4f4-7dc4-4ed0-bd10-e526ab2f6f81", "enable_snat": false} |
+-----------------------+------------------------------------------------------------------------------+
(neutron) router-gateway-set router pub2
Set gateway for router router
(neutron) router-show router1 -c external_gateway_info
+-----------------------+------------------------------------------------------------------------------+
| Field | Value |
+-----------------------+------------------------------------------------------------------------------+
| external_gateway_info | {"network_id": "a32bcb44-165a-4de8-a8db-35f6ff8f2712", "enable_snat": false} |
+-----------------------+------------------------------------------------------------------------------+

==> enable_snat == False not lost during router-gateway-set

Tags: l3-ipam-dhcp
Changed in neutron:
status: New → In Progress
assignee: nobody → Cedric Brandily (cbrandily)
tags: added: l3-ipam-dhcp
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/130199

Changed in neutron:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/130199
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=ccd30a8cab6b91259cfb09b16a8fbbf69747cdf4
Submitter: Jenkins
Branch: master

commit ccd30a8cab6b91259cfb09b16a8fbbf69747cdf4
Author: Cedric Brandily <email address hidden>
Date: Wed Oct 22 14:03:13 2014 +0200

    Correct inconsistent enable_snat management

    Neutron resets enable_snat attribute when external_gateway_info is
    cleared but not when external_gateway_info is only updated which
    implies the following sets of actions have different behaviors:

      neutron router-gateway-set router1 pub1 --disable-snat
      neutron router-gateway-set router1 pub2

    enable_snat is False after the last command

      neutron router-gateway-set router1 pub1 --disable-snat
      neutron router-gateway-clear router1
      neutron router-gateway-set router1 pub2

    enable_snat is True after the 2nd command resets the gateway AND
    enable_snat.

    This change proposes to always reset the attribute enable_snat when
    enable_snat is not provided in external_gateway_info on POST/PUT for
    consistency.

    APIImpact
    Change-Id: Ibab289936c55b1cf9614b44a4f18f54c959ee9e8
    Closes-Bug: #1384146

Changed in neutron:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (neutron-pecan)

Fix proposed to branch: neutron-pecan
Review: https://review.openstack.org/185072

Thierry Carrez (ttx)
Changed in neutron:
milestone: none → liberty-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: liberty-1 → 7.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.