Try ipaddr filter from collection

Going forward, many of the filters and code that used to be in ansible
core were moved to collections. We use the ipaddr filter in a few places
so in order to support newer versions, we need to try to load the
collection version first before falling back to the legacy one in
ansible <=2.9

Change-Id: If1d273da61041fa4b7b9f4430264acda1d3841e8
changes/53/760953/2
Alex Schultz 2 years ago committed by Kevin Carter
parent 0f6aae588c
commit 5eff049403
  1. 5
      tripleo_ansible/ansible_plugins/action/tripleo_all_nodes_data.py
  2. 5
      tripleo_ansible/ansible_plugins/action/tripleo_iptables.py

@ -46,7 +46,10 @@ import traceback
from ansible.errors import AnsibleError
from ansible.plugins.action import ActionBase
from ansible.plugins.filter import ipaddr
try:
from ansible_collections.ansible.netcommon.plugins.filter import ipaddr
except ImportError:
from ansible.plugins.filter import ipaddr
from ansible.utils.display import Display

@ -50,7 +50,10 @@ EXAMPLES = """
from ansible.plugins.action import ActionBase
from ansible.plugins.filter import ipaddr
try:
from ansible_collections.ansible.netcommon.plugins.filter import ipaddr
except ImportError:
from ansible.plugins.filter import ipaddr
from ansible.utils.display import Display

Loading…
Cancel
Save