[BUG] pip.installed with upgrade=True and index_url doesn't work
Description Issue #59100 was closed as having done what was possible for Aluminium, and the situation has indeed improved. There is, however, still an issue when used together with the index_url argument.
Setup With a state like this:
pip3:
pip.installed:
- name: pip
- upgrade: True
Everything works as expected. But with
pip3:
pip.installed:
- name: pip
- upgrade: True
- index_url: https://pypi.python.org/simple
It always returns "the available upgrade doesn't fulfills the version requirements".
Expected behavior These two should behave the same
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey. Please be sure to review our Code of Conduct. Also, check out some of our community resources including:
- Community Wiki
- Salt’s Contributor Guide
- Join our Community Slack
- IRC on LiberaChat
- Salt Project YouTube channel
- Salt Project Twitch channel
There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. If you have additional questions, email us at [email protected]. We’re glad you’ve joined our community and look forward to doing awesome things with you!
I had a quick look at the code myself, and it looks like this commit: https://github.com/saltstack/salt/commit/eaf061a688646518a124965f797fa1a7f99431cb put the code slightly out of place. At the moment the --index-url argument is put right after "pip", but it needs to go after "index versions" or "install".
@s0undt3ch might know more about the reasoning on the location in the code? I.e. could the new code go back to where "install" was previously appended to the command as well?
closed by https://github.com/saltstack/salt/pull/61645