ansible-collections-openstack/tests/unit
Jakob Meng 0ec16fbecc Dropped extra interfaces_info attribute from routers_info module
routers_info's interfaces_info attribute is not provided by
openstacksdk, it is added to each router resource by the routers_info
module after retrieving the routers list. To get the required data
list_router_interfaces() [1] is being called for each router resource
which then retrieves all ports for each router. This requires extra
api calls which might be useless because we do not know whether the
user actually cares about the ports. For getting ports of a router
we have the openstack.cloud.ports module. So instead of proactively
retrieving the router ports we drop the interfaces_info attribute.

The interfaces_info attribute was introduced because retrieving
interfaces via openstacksdk and openstack.cloud modules was
complex in the past [2]. Nowadays, using openstack.cloud.ports
Ansible and Jinja2 filters retrieving ip addresses of a router
is straight forward. In case someone still needs the old
interfaces_info attribute, one can refer to the module example
to see how it could be reproduced. But in general, retrieving the
router interfaces is much easier as can be seen in the updated
integration tests.

[1] 3f81d0001d/openstack/cloud/_network.py (L1926)
[2] https://review.opendev.org/c/openstack/ansible-collections-openstack/+/703927/6/plugins/modules/os_routers_info.py

Change-Id: I7fbdf11d07c95421d3aee800bfeebb88ea829817
2022-08-11 08:37:10 +00:00
..
compat Fix ansible-tests for devel branch 2020-06-03 00:05:07 +03:00
mock Remove from __future__ lines 2020-03-01 06:26:03 -06:00
modules Dropped extra interfaces_info attribute from routers_info module 2022-08-11 08:37:10 +00:00
plugins Remove from __future__ lines 2020-03-01 06:26:03 -06:00
__init__.py Migrate openstack modules as a collection 2020-01-17 14:07:24 +00:00
requirements.txt Cleanup unit test requirements 2020-02-20 11:57:27 +01:00