mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-05-06 13:23:06 +00:00
Dropped deprecated return values in floating_ip_info and assert remaining fields
Attributes such as location and tenant_id are computed by OpenStack
SDK. We do not return these fields in floating_ip_info because e.g.
tenant_id has been marked as deprecated and is a copy of the
project_id field.
Ref.: 70a06d9990
Added an assertion to CI which checks that all advertised fields
are returned by floating_ip_info. This helps with detecting breaking
changes in future updates.
Change-Id: I62e4681cd57f82054f68efe1dc59be2cca118135
This commit is contained in:
@@ -165,7 +165,6 @@ class FloatingIPInfoModule(OpenStackModule):
|
||||
router = self.params['router']
|
||||
status = self.params['status']
|
||||
|
||||
data = []
|
||||
query = {}
|
||||
if description:
|
||||
query['description'] = description
|
||||
@@ -194,15 +193,8 @@ class FloatingIPInfoModule(OpenStackModule):
|
||||
if status:
|
||||
query['status'] = status.upper()
|
||||
|
||||
for raw in self.conn.network.ips(**query):
|
||||
dt = raw.to_dict()
|
||||
dt.pop('location')
|
||||
data.append(dt)
|
||||
|
||||
self.exit_json(
|
||||
changed=False,
|
||||
floating_ips=data
|
||||
)
|
||||
ips = [ip.to_dict(computed=False) for ip in self.conn.network.ips(**query)]
|
||||
self.exit_json(changed=False, floating_ips=ips)
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
Reference in New Issue
Block a user