]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Correct inconsistent enable_snat management
authorCedric Brandily <zzelle@gmail.com>
Wed, 22 Oct 2014 12:03:13 +0000 (14:03 +0200)
committerCedric Brandily <zzelle@gmail.com>
Mon, 20 Apr 2015 22:02:36 +0000 (00:02 +0200)
commitccd30a8cab6b91259cfb09b16a8fbbf69747cdf4
treedb924ea0bfb9877325e9584671e97d02900ba06e
parent483de6313fab5913f9e68eb24afe65c36bd9b623
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
neutron/db/l3_gwmode_db.py
neutron/tests/unit/extensions/test_l3_ext_gw_mode.py