python-openstackclient/openstackclient/tests/unit
melanie witt 013c9a4f3a Handle multiple ports in AddFloatingIP
AddFloatingIP refers to an old nova proxy API to neutron that was
deprecated in nova. The neutron API for floating IP associate requires
a port to be specified. Currently, the code is selecting the first port
if the server has multiple ports. But, an attempt to associate the
first port with a floating IP can fail if the first port is not on a
network that is attached to an external gateway.

In order to make the command work better for users who have a server
with multiple ports, we can:

  1. Select the port corresponding to the fixed_ip_address, if one was
     specified

  2. Try to associate the floating IP with each port until one of the
     attempts succeeds, else re-raise the last exception.
     (404 ExternalGatewayForFloatingIPNotFound from neutron)

This also fixes incorrect FakeFloatingIP attributes that were being set
in the TestServerAddFloatingIPNetwork unit tests, which were causing
the tests to use None as parsed args for ip-address and
--fixed-ip-address and thus bypassing code in the
'if parsed_args.fixed_ip_address:' block.

Task: 27800
Story: 2004263

Change-Id: I11fbcebf6b00f12a030b000c84dcf1d6b5e86250
2018-11-06 20:18:13 +00:00
..
api Re-implement novaclient bits removed in 10.0 2018-03-13 09:10:45 -05:00
common Fix 'project purge' deleting wrong project's servers and volumes 2018-09-14 10:23:14 +01:00
compute Handle multiple ports in AddFloatingIP 2018-11-06 20:18:13 +00:00
identity Allow endpoint filtering on both project and project-domain 2018-10-09 13:23:49 +00:00
image Merge "Support --community in openstack image list" 2018-07-25 02:49:02 +00:00
integ Fix SDK Connection creation alternative to Profile 2017-12-07 08:10:23 -06:00
network Merge "Add DNS support to floating IP commands" 2018-08-08 20:15:07 +00:00
object Use flake8-import-order plugin 2017-08-17 06:55:00 +00:00
volume Merge "Address issues from volume backend commands" 2018-11-02 18:00:32 +00:00
__init__.py move unit tests to new "unit" test module 2016-09-08 15:19:50 -07:00
fakes.py Adding api_version to FakeApp 2018-06-24 03:47:23 +00:00
test_shell.py Use flake8-import-order plugin 2017-08-17 06:55:00 +00:00
utils.py Use flake8-import-order plugin 2017-08-17 06:55:00 +00:00