diff --git a/changelog/60557.fixed b/changelog/60557.fixed new file mode 100644 index 00000000000..0634bc83952 --- /dev/null +++ b/changelog/60557.fixed @@ -0,0 +1 @@ +Fix regression pip.installed does not pass env_vars when calling pip.list diff --git a/salt/states/pip_state.py b/salt/states/pip_state.py index f7a0ae3f2ba..542a7f6c751 100644 --- a/salt/states/pip_state.py +++ b/salt/states/pip_state.py @@ -845,9 +845,11 @@ def installed( # No requirements case. # Check pre-existence of the requested packages. else: - # Attempt to pre-cache a the current pip list + # Attempt to pre-cache the current pip list try: - pip_list = __salt__["pip.list"](bin_env=bin_env, user=user, cwd=cwd) + pip_list = __salt__["pip.list"]( + bin_env=bin_env, user=user, cwd=cwd, env_vars=env_vars + ) # If we fail, then just send False, and we'll try again in the next function call except Exception as exc: # pylint: disable=broad-except log.exception(exc)