handle non strings in requirements version for ansible-galaxy (#52109)

pull/52673/head
Veaceslav Mindru 6 years ago committed by Sam Doran
parent 90a199a0ee
commit 6f91bccf78

@ -0,0 +1,2 @@
bugfixes:
- handle non strings in requirements version for ansible-galaxy

@ -32,6 +32,7 @@ from ansible.module_utils.common.process import get_bin_path
from ansible.module_utils.six import string_types
from ansible.playbook.role.definition import RoleDefinition
from ansible.utils.display import Display
from ansible.module_utils._text import to_text
__all__ = ['RoleRequirement']
@ -163,7 +164,7 @@ class RoleRequirement(RoleDefinition):
run_scm_cmd(clone_cmd, tempdir)
if scm == 'git' and version:
checkout_cmd = [scm_path, 'checkout', version]
checkout_cmd = [scm_path, 'checkout', to_text(version)]
run_scm_cmd(checkout_cmd, os.path.join(tempdir, name))
temp_file = tempfile.NamedTemporaryFile(delete=False, suffix='.tar', dir=C.DEFAULT_LOCAL_TMP)

Loading…
Cancel
Save