fixed password.fetch option not using environment

the '_strategy_command' in 'fetchparams.cli' did not expand the path of
every argument, but only the first one (being the command to be
executed).
i fixed the '_strategy_command' function to apply the 'expand_path'
function to every member of the commands list.
This commit is contained in:
Witcher01 2020-07-24 14:42:27 +02:00 committed by Hugo Osvaldo Barrera
parent cfd5af832a
commit c254b4ad1d
2 changed files with 5 additions and 1 deletions

View file

@ -13,6 +13,7 @@ In alphabetical order:
- Markus Unterwaditzer
- Michael Adler
- Thomas Weißschuh
- Witcher01
Special thanks goes to:

View file

@ -77,7 +77,10 @@ def _fetch_value(opts, key):
def _strategy_command(*command):
import subprocess
command = (expand_path(command[0]),) + command[1:]
# normalize path of every path member
# if there is no path specified then nothing will happen
command = map(expand_path, command)
try:
stdout = subprocess.check_output(command, universal_newlines=True)
return stdout.strip("\n")