Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker_service python 3 compat #30696

Closed
wants to merge 2 commits into from

Commits on Sep 21, 2017

  1. Clean code, fd.close not required since open as fd if used; remove ge…

    …t_redirected_output from cleanup_redirection_tempfiles since output is not used
    dj4ngo committed Sep 21, 2017
    Copy the full SHA
    bae2070 View commit details
    Browse the repository at this point in the history
  2. Solve issue with .encode('ascii') in python 3.5, replaced by to_text …

    …method
    
    Don't use --no-color option because replaced by --no-ansi to ensure compatibility
    
    The full traceback is:
    Traceback (most recent call last):
      File "/tmp/ansible_y084ix0x/ansible_module_docker_service.py", line 1068, in <module>
        main()
      File "/tmp/ansible_y084ix0x/ansible_module_docker_service.py", line 1063, in main
        result = ContainerManager(client).exec_module()
      File "/tmp/ansible_y084ix0x/ansible_module_docker_service.py", line 657, in exec_module
        result = self.cmd_up()
      File "/tmp/ansible_y084ix0x/ansible_module_docker_service.py", line 753, in cmd_up
        cleanup_redirection_tempfiles(out_redir_name, err_redir_name)
      File "/tmp/ansible_y084ix0x/ansible_module_docker_service.py", line 515, in cleanup_redirection_tempfiles
        get_redirected_output(err_name)
      File "/tmp/ansible_y084ix0x/ansible_module_docker_service.py", line 524, in get_redirected_output
        new_line = re.sub(r'\x1b\[.+m', '', line.encode('ascii'))
      File "/usr/lib/python3.5/re.py", line 182, in sub
        return _compile(pattern, flags).sub(repl, string, count)
    TypeError: cannot use a string pattern on a bytes-like object
    dj4ngo committed Sep 21, 2017
    Copy the full SHA
    177c609 View commit details
    Browse the repository at this point in the history