Document password_command behavior in keyring.rst

This commit is contained in:
Markus Unterwaditzer 2015-07-16 15:18:31 +02:00
parent 0e11d2ea0e
commit 60a7778cea
2 changed files with 5 additions and 1 deletions

View file

@ -15,6 +15,10 @@ Custom command
A custom command/binary can be specified to retrieve the password for a
username/hostname combination. See :ref:`general_config`.
.. versionchanged:: 0.6.0
Setting a custom command now disables all other methods.
netrc
=====

View file

@ -118,7 +118,7 @@ def _password_from_command(username, host):
try:
stdout = subprocess.check_output(command + [username, host],
universal_newlines=True)
return stdout.strip('\n') or None
return stdout.strip('\n')
except OSError as e:
raise exceptions.UserError('Failed to execute command: {}\n{}'.
format(' '.join(command), str(e)))