Recently, a user reported that the bigip_facts module was failing with the error
received exception: object of type 'itertools.imap' has no len()
This reported was occurring at line 1657 of the bigip_facts module
bug report is here
https://github.com/F5Networks/f5-ansible/issues/25
Upon further investigation, the map function for returning the specified
includes was returning an iterator, and calling len() on an iterator does
not work.
I believe this problem was caused by part of the Python 3.x effort insofar
as the inclusion of this line
https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/basic.py#L143
seems to affect our usage of map(), probably for the better anyway, and we need
to change our expectations in our module's code to no longer assume a list, but
instead assume an iterator.
After trawling through the module_utils/basic code, I think a list
comprehension is more appropriate here anyway, so I'm changing it to be
that. The affected user reported it works this way, and my own testing
on 2.2.0 supports that.
A number of coding conventions have been adopted for new F5 modules
that are in development. To ensure common usage across the modules,
this module needed to be updated to reflect those conventions.
No functional code changes were made.
This patch adds support for the server_port module. It
additionally updates the documentation in the module for
it.
The changes were tested in the f5-ansible repository to
ensure no breaking changes were made. This argument allows
modules to be used on BIG-IPs that are listening on
non-standard ports.
As is done in other ansible modules, this adds the __main__ check
to the module so that the module code itself can be used as a library.
For instance, when testing the code.
The device option was already implemented but omitted from docs and allowed
choices. With the addition of device, a devices failover_state can be
determined.