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:
Toshio Kuratomi
2016-08-25 07:30:03 -07:00
committed by GitHub
parent c2d87816a8
commit 44d979c8f5
11 changed files with 23 additions and 29 deletions

View File

@@ -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'):