Skip to content

Commit

Permalink
Fix version comparison
Browse files Browse the repository at this point in the history
The task always run when pip_version is provided with 1 or 2 digits
(eg: 18, 18.0) because it gets converted to number and the comparison was
always true.
  • Loading branch information
Jonathan Piron authored and cognifloyd committed Nov 28, 2018
1 parent 17cda52 commit cf92577
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
- name: Install required version of pip.
command: "{{ pip }} install pip=={{ pip_version }}"
become: yes
when: pip_version and pip_installed_version.stdout != pip_version and (pip_version | lower) != "latest"
when: pip_version and pip_installed_version.stdout is version_compare(pip_version, '!=') and (pip_version | lower) != "latest"

- name: Upgrade to latest version of pip.
command: "{{ pip }} {{ '--proxy=' + pip_proxy + ' ' if pip_proxy != '' else '' }}install -U pip"
Expand Down

0 comments on commit cf92577

Please sign in to comment.