Skip to content

Commit 22ba48b

Browse files
committed
refactor: comply with Ansible partner certification checks
comply with Ansible partner certification checks Ansible is deprecating ansible six, so replace the functionality we use with our own lsr_string_types Add ansible-test sanity ignores for the milestone version Signed-off-by: Rich Megginson <rmeggins@redhat.com>
1 parent c0293b2 commit 22ba48b

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

.ansible/.lock

Whitespace-only changes.

.sanity-ansible-ignore-2.21.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
plugins/modules/firewall_lib.py validate-modules:missing-gplv3-license
2+
plugins/modules/firewall_lib_facts.py validate-modules:missing-gplv3-license

library/firewall_lib.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -583,11 +583,17 @@
583583
export_config_dict,
584584
recursive_show_diffs,
585585
)
586-
from ansible.module_utils.six import string_types
587586
import re
588587
import os
589588
import copy
590589

590+
# ansible six is deprecated, and it seems a lot to add a dependency on python-six
591+
# just for this
592+
try:
593+
lsr_string_types = basestring,
594+
except NameError:
595+
lsr_string_types = str,
596+
591597
try:
592598
import ipaddress
593599

@@ -738,7 +744,7 @@ def get_ipset_entries_type(ipset_entries, module):
738744
# ipset options values must be strings
739745
def normalize_ipset_options(ipset_options):
740746
for option, value in ipset_options.items():
741-
if value is not None and not isinstance(value, string_types):
747+
if value is not None and not isinstance(value, lsr_string_types):
742748
ipset_options[option] = str(value)
743749

744750

@@ -2766,7 +2772,7 @@ def parse_forward_port(module, item):
27662772
else:
27672773
_to_port = None
27682774
_to_addr = item.get("toaddr")
2769-
elif isinstance(item, string_types):
2775+
elif isinstance(item, lsr_string_types):
27702776
args = item.split(";")
27712777
if len(args) == 3:
27722778
__port, _to_port, _to_addr = args

0 commit comments

Comments
 (0)