mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-04 15:34:01 -07: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:
parent
c2d87816a8
commit
44d979c8f5
11 changed files with 23 additions and 29 deletions
|
@ -39,7 +39,7 @@ from ansible.galaxy.role import GalaxyRole
|
|||
from ansible.galaxy.login import GalaxyLogin
|
||||
from ansible.galaxy.token import GalaxyToken
|
||||
from ansible.playbook.role.requirement import RoleRequirement
|
||||
from ansible.utils.unicode import to_unicode
|
||||
from ansible.utils.unicode import to_bytes, to_unicode
|
||||
|
||||
try:
|
||||
from __main__ import display
|
||||
|
@ -193,7 +193,7 @@ class GalaxyCLI(CLI):
|
|||
os.makedirs(role_path)
|
||||
readme_path = os.path.join(role_path, "README.md")
|
||||
f = open(readme_path, "wb")
|
||||
f.write(self.galaxy.default_readme)
|
||||
f.write(to_bytes(self.galaxy.default_readme))
|
||||
f.close()
|
||||
|
||||
# create default .travis.yml
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue