Remove more Python 2 handling from tests (#82449)

pull/80625/merge
Sloane Hertel 4 months ago committed by GitHub
parent 71a5212586
commit b5649f9686
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -9,15 +9,9 @@
- name: show python version
debug: var=ansible_python_version
- name: use python-apt
set_fact:
python_apt: python-apt
when: ansible_python_version is version('3', '<')
- name: use python3-apt
set_fact:
python_apt: python3-apt
when: ansible_python_version is version('3', '>=')
# UNINSTALL 'python-apt'
# The `apt_repository` module has the smarts to auto-install `python-apt`. To

@ -543,15 +543,9 @@
- 'parent_dir_cd.stdout.endswith(remote_tmp_dir ~ "/www")'
- 'parent_dir_chdir.stdout.endswith(remote_tmp_dir ~ "/www_root")'
- name: Set print error command for Python 2
set_fact:
print_error_command: print >> sys.stderr, msg
when: ansible_facts.python_version is version('3', '<')
- name: Set print error command for Python 3
set_fact:
print_error_command: print(msg, file=sys.stderr)
when: ansible_facts.python_version is version('3', '>=')
- name: run command with strip
command: '{{ ansible_python_interpreter }} -c "import sys; msg=''hello \n \r''; print(msg); {{ print_error_command }}"'

@ -17,4 +17,3 @@
loop: "{{ algorithms.keys() }}"
loop_control:
loop_var: algorithm
when: ansible_python_version.startswith('3.') or not algorithm.startswith('sha3_')

@ -1,2 +1 @@
pexpect == 4.8.0
ptyprocess < 0.7.0 ; python_version < '2.7' # ptyprocess >= 0.7.0 not compatible with Python 2.6

Loading…
Cancel
Save