openstack-python-openstackc.../openstackclient/compute/v2
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
..
__init__.py Remove copyright from empty files 2014-01-20 17:28:13 +04:00
agent.py translate all command help strings 2016-11-17 02:33:42 +00:00
aggregate.py Handle log message interpolation by the logger in compute/ 2017-02-13 18:43:12 +01:00
console.py Fix crashing "console log show" 2018-03-16 11:30:51 -05:00
fixedip.py translate all command help strings 2016-11-17 02:33:42 +00:00
flavor.py Compute: Add description support for flavor 2018-06-20 09:11:05 +00:00
floatingip.py translate all command help strings 2016-11-17 02:33:42 +00:00
host.py compute: host: expand kwargs in host_set() call 2018-07-20 10:37:34 +02:00
hypervisor.py translate all command help strings 2016-11-17 02:33:42 +00:00
hypervisor_stats.py translate all command help strings 2016-11-17 02:33:42 +00:00
keypair.py Add "--private-key" option for "keypair create" 2017-03-06 08:34:28 +00:00
server.py Handle multiple ports in AddFloatingIP 2018-11-06 20:18:13 +00:00
server_backup.py Fix additional output encoding issues 2018-03-20 15:40:23 -05:00
server_event.py Use flake8-import-order plugin 2017-08-17 06:55:00 +00:00
server_group.py Remove hard-coded policy choices for creating a server group 2017-11-19 18:45:28 -05:00
server_image.py Fix additional output encoding issues 2018-03-20 15:40:23 -05:00
service.py compute: limit the service's force down command above 2.10 2018-06-19 12:59:03 +00:00
usage.py Fix additional output encoding issues 2018-03-20 15:40:23 -05:00