Skip to content

Commit d6a3ffc

Browse files
xwjiang-msmssonicbld
authored andcommitted
Pin requests to version 2.31.0 in main.yml (#12959)
What is the motivation for this PR? In latest requests python package, would got error in some steps like add-topo and restart-ptf with message 'Not supported URL scheme http+docker' We already have fix PR #12910 in master branch to install stable requests version in docker.yml, but once package_installation was set to false like restart-ptf, docker.yml would skip and report error again How did you do it? Install stable requests version in main.yml after executing docker.yml to cover all scenario
1 parent 84256ca commit d6a3ffc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

ansible/roles/vm_set/tasks/main.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,21 @@
124124
- include_tasks: docker.yml
125125
when: package_installation|bool
126126

127+
- name: Update python3 packages
128+
block:
129+
# Workaround for '"Error connecting: Error while fetching server API version: Not supported URL scheme http+docker'
130+
# See https://github.com/docker/docker-py/issues/3256
131+
- name: Remove old requests package >=2.32.0
132+
pip: name=requests state=absent executable={{ pip_executable }}
133+
become: yes
134+
environment: "{{ proxy_env | default({}) }}"
135+
ignore_errors: yes
136+
- name: Install requests package <2.32.0
137+
pip: name=requests version=2.31.0 state=present executable={{ pip_executable }}
138+
become: yes
139+
environment: "{{ proxy_env | default({}) }}"
140+
when: pip_executable=="pip3"
141+
127142
- name: Ensure {{ ansible_user }} in docker,sudo group
128143
user:
129144
name: "{{ ansible_user }}"

0 commit comments

Comments
 (0)