ansible.utils/docs
Tim Way 57c5cd4336
Switch To Calculating Networking Information Directly For Performance (#146)
* Add Unit Tests To Capture Failures From 'subnet' Generator

The netaddr library returns a generator for the 'subnet' call. This works great until you use larger networks. While it is uncommon to encounter it in IPv4 usage it is trivial to hit it in IPv6.

* Switch To Calculating Networking Information Directly For Performance

This replaces the inefficient generator for 'subnet' and uses math to determine the result directly. Since a list is not returned directly to the client in the implemented cases this works great and is fast.

A further optimization at least on the logic of this might be to break the different cases implemented by the filter out into unique functions. I did not do this yet because I wanted to get feedback on this direction.

* Changelog Fragment For PR / Bugfix

Adding changelog fragment that references source issue.

* Dropping Python 3.7 Bypass Removes Need For 'sys' Module

A test for ipsubnet was bypassed under 3.7 because of an inconsistent return value w/3.6 and 2.7. I removed the bypass and changed the behavior of the filter to raise an AnsibleFilterError in all versions of Python.

* Add A Pair of Integration Tests

These demonstrate the issue with the current implementation and would normally stall out while building the list of possible subnets from the generator.

* Address Changelog Feedback

I kept the performance item as a bugfix but bumped the typing to a minor change.

* Add 'netaddr' To Integration Test 'requirements.txt'

* The `ansible-test integration --docker` requires this line in requirements.txt to pass the 'netaddr' related tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Replace str -> to_text

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Kate Case <this.is@katherineca.se>
2022-08-31 12:09:35 -04:00
..
docsite move ipaddr filter docs into collection (#144) 2022-02-24 15:51:40 +00:00
ansible.utils.cidr_merge_filter.rst Fix bugs in Ipaddr filters (#149) 2022-03-04 11:43:59 +00:00
ansible.utils.cli_parse_module.rst Add pre-commit config file (#62) 2021-03-31 17:43:38 +00:00
ansible.utils.consolidate_filter.rst sanity fix 2022-04-11 17:20:49 +05:30
ansible.utils.fact_diff_module.rst Add pre-commit config file (#62) 2021-03-31 17:43:38 +00:00
ansible.utils.from_xml_filter.rst Add to_xml and from_xml filter plugin (#56) 2021-04-09 13:20:17 +00:00
ansible.utils.get_path_filter.rst Add pre-commit config file (#62) 2021-03-31 17:43:38 +00:00
ansible.utils.get_path_lookup.rst Enable update docs via pre-commit (#186) 2022-05-25 15:53:41 -07:00
ansible.utils.hwaddr_filter.rst Add hwaddr, macaddr, slaac filter plugin (#129) 2022-01-24 21:43:18 +00:00
ansible.utils.in_any_network_test.rst minor doc fix (#140) 2022-02-10 17:35:19 +00:00
ansible.utils.in_network_test.rst Added 'ip', 'ip_address' test plugins (#68) 2021-05-06 11:12:27 +00:00
ansible.utils.in_one_network_test.rst Added 'in_any_network', 'in_network', 'in_one_network' test plugins (#66) 2021-05-03 14:22:35 +00:00
ansible.utils.index_of_filter.rst Add pre-commit config file (#62) 2021-03-31 17:43:38 +00:00
ansible.utils.index_of_lookup.rst Enable update docs via pre-commit (#186) 2022-05-25 15:53:41 -07:00
ansible.utils.ip4_hex_filter.rst Add ipv4_hex filter plugin (#119) 2022-01-20 11:48:12 +00:00
ansible.utils.ip_address_test.rst Added 'ip', 'ip_address' test plugins (#68) 2021-05-06 11:12:27 +00:00
ansible.utils.ip_test.rst Added 'ip', 'ip_address' test plugins (#68) 2021-05-06 11:12:27 +00:00
ansible.utils.ipaddr_filter.rst Fix bugs in Ipaddr filters (#149) 2022-03-04 11:43:59 +00:00
ansible.utils.ipmath_filter.rst Fix bugs in Ipaddr filters (#149) 2022-03-04 11:43:59 +00:00
ansible.utils.ipsubnet_filter.rst Switch To Calculating Networking Information Directly For Performance (#146) 2022-08-31 12:09:35 -04:00
ansible.utils.ipv4_address_test.rst Added ipv4 specefic test plugins (#69) 2021-05-07 18:30:00 +00:00
ansible.utils.ipv4_filter.rst Fix bugs in Ipaddr filters (#149) 2022-03-04 11:43:59 +00:00
ansible.utils.ipv4_hostmask_test.rst Added ipv4 specefic test plugins (#69) 2021-05-07 18:30:00 +00:00
ansible.utils.ipv4_netmask_test.rst Added ipv4 specefic test plugins (#69) 2021-05-07 18:30:00 +00:00
ansible.utils.ipv4_test.rst Added ipv4 specefic test plugins (#69) 2021-05-07 18:30:00 +00:00
ansible.utils.ipv6_address_test.rst Added ipv6 test plugins (#70) 2021-05-10 18:19:24 +00:00
ansible.utils.ipv6_filter.rst Fix bugs in Ipaddr filters (#149) 2022-03-04 11:43:59 +00:00
ansible.utils.ipv6_ipv4_mapped_test.rst Added ipv6 test plugins (#70) 2021-05-10 18:19:24 +00:00
ansible.utils.ipv6_sixtofour_test.rst Added ipv6 test plugins (#70) 2021-05-10 18:19:24 +00:00
ansible.utils.ipv6_teredo_test.rst Added ipv6 test plugins (#70) 2021-05-10 18:19:24 +00:00
ansible.utils.ipv6_test.rst Added ipv6 test plugins (#70) 2021-05-10 18:19:24 +00:00
ansible.utils.ipwrap_filter.rst Fix bugs in Ipaddr filters (#149) 2022-03-04 11:43:59 +00:00
ansible.utils.keep_keys_filter.rst doc fixes (#134) 2022-01-31 10:30:34 +00:00
ansible.utils.loopback_test.rst Added 'loopback', 'mac', and 'multicast' test plugins (#71) 2021-05-11 16:23:05 +00:00
ansible.utils.mac_test.rst Added 'loopback', 'mac', and 'multicast' test plugins (#71) 2021-05-11 16:23:05 +00:00
ansible.utils.macaddr_filter.rst Add hwaddr, macaddr, slaac filter plugin (#129) 2022-01-24 21:43:18 +00:00
ansible.utils.multicast_test.rst Added 'loopback', 'mac', and 'multicast' test plugins (#71) 2021-05-11 16:23:05 +00:00
ansible.utils.network_in_network_filter.rst Add network_in_network filter plugin (#125) 2022-01-20 19:31:40 +00:00
ansible.utils.network_in_usable_filter.rst Add network_in_usable filter plugin (#126) 2022-01-21 20:12:17 +00:00
ansible.utils.next_nth_usable_filter.rst Fix bugs in Ipaddr filters (#149) 2022-03-04 11:43:59 +00:00
ansible.utils.nthhost_filter.rst Add Nthhost filter plugin (#128) 2022-01-19 19:10:50 +00:00
ansible.utils.param_list_compare_filter.rst param_list_compare filter plugins docs updated (#91) 2021-08-27 15:27:02 +00:00
ansible.utils.previous_nth_usable_filter.rst Fix bugs in Ipaddr filters (#149) 2022-03-04 11:43:59 +00:00
ansible.utils.private_test.rst Added 'private', 'public', 'reserved' test plugins (#72) 2021-05-12 15:42:19 +00:00
ansible.utils.public_test.rst Added 'private', 'public', 'reserved' test plugins (#72) 2021-05-12 15:42:19 +00:00
ansible.utils.reduce_on_network_filter.rst Add plugin Reduce_on_network (#127) 2022-01-21 10:34:01 +00:00
ansible.utils.remove_keys_filter.rst Recursive filter plugins remove_keys | replace_keys | keep_keys (#110) 2022-01-27 06:52:38 +00:00
ansible.utils.replace_keys_filter.rst Recursive filter plugins remove_keys | replace_keys | keep_keys (#110) 2022-01-27 06:52:38 +00:00
ansible.utils.reserved_test.rst Added 'private', 'public', 'reserved' test plugins (#72) 2021-05-12 15:42:19 +00:00
ansible.utils.resolvable_test.rst Added 'resolvable' test plugin (#74) 2021-05-14 20:24:11 +00:00
ansible.utils.slaac_filter.rst Fix bugs in Ipaddr filters (#149) 2022-03-04 11:43:59 +00:00
ansible.utils.subnet_of_test.rst Added 'subnet_of', 'supernet_of', 'unspecified' IP test plugins (#73) 2021-05-14 14:01:41 +00:00
ansible.utils.supernet_of_test.rst Added 'subnet_of', 'supernet_of', 'unspecified' IP test plugins (#73) 2021-05-14 14:01:41 +00:00
ansible.utils.to_paths_filter.rst Add pre-commit config file (#62) 2021-03-31 17:43:38 +00:00
ansible.utils.to_paths_lookup.rst Enable update docs via pre-commit (#186) 2022-05-25 15:53:41 -07:00
ansible.utils.to_xml_filter.rst Add to_xml and from_xml filter plugin (#56) 2021-04-09 13:20:17 +00:00
ansible.utils.unspecified_test.rst Added 'subnet_of', 'supernet_of', 'unspecified' IP test plugins (#73) 2021-05-14 14:01:41 +00:00
ansible.utils.update_fact_module.rst doc fixes (#134) 2022-01-31 10:30:34 +00:00
ansible.utils.usable_range_filter.rst Fix documentation issues (#80) 2021-06-21 23:48:07 +00:00
ansible.utils.validate_filter.rst doc fixes (#134) 2022-01-31 10:30:34 +00:00
ansible.utils.validate_lookup.rst doc fixes (#134) 2022-01-31 10:30:34 +00:00
ansible.utils.validate_module.rst New validate sub-plugin "config" (#112) 2022-01-28 00:02:36 +00:00
ansible.utils.validate_test.rst Add pre-commit config file (#62) 2021-03-31 17:43:38 +00:00