From e253897675b77da452c269010fb313e2bf65208c Mon Sep 17 00:00:00 2001 From: nicholasmhughes Date: Wed, 21 Dec 2022 10:14:49 -0500 Subject: [PATCH] fixes saltstack/salt#60557 regression pip.installed does not pass env_vars when calling pip.list --- changelog/60557.fixed | 1 + salt/states/pip_state.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 changelog/60557.fixed 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)