mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Enable most unittests on python3 (just some vault unittests and a logging one left) (#17240)
Make some python3 fixes to make the unittests pass: * galaxy imports * dictionary iteration in role requirements * swap_stdout helper for unittests * Normalize to text string in a facts.py function
This commit is contained in:
@@ -34,6 +34,7 @@ import pwd
|
||||
|
||||
from ansible.module_utils.basic import get_all_subclasses
|
||||
from ansible.module_utils.six import PY3, iteritems
|
||||
from ansible.module_utils._text import to_text
|
||||
|
||||
# py2 vs py3; replace with six via ansiballz
|
||||
try:
|
||||
@@ -357,6 +358,7 @@ class Facts(object):
|
||||
proc_1 = os.path.basename(proc_1)
|
||||
|
||||
if proc_1 is not None:
|
||||
proc_1 = to_text(proc_1)
|
||||
proc_1 = proc_1.strip()
|
||||
|
||||
if proc_1 == 'init' or proc_1.endswith('sh'):
|
||||
|
||||
Reference in New Issue
Block a user