diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8797d04..b9a4874 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -9,6 +9,12 @@ Package maintainers and users who have to manually update their installation may want to subscribe to `GitHub's tag feed `_. +Version 0.5.3 +============= + +- ``password_command`` invocations with non-zero exit code are now fatal (and + will abort synchronization) instead of just producing a warning. + Version 0.5.2 ============= diff --git a/vdirsyncer/utils/password.py b/vdirsyncer/utils/password.py index 9f22848..492866d 100644 --- a/vdirsyncer/utils/password.py +++ b/vdirsyncer/utils/password.py @@ -4,7 +4,7 @@ import threading from . import expand_path from .compat import urlparse -from .. import log +from .. import exceptions, log from ..doubleclick import click, ctx logger = log.get(__name__) @@ -115,7 +115,7 @@ def _password_from_command(username, host): try: stdout = subprocess.check_output(command + [username, host], universal_newlines=True) - return stdout.strip() + return stdout.strip('\n') or None except OSError as e: - logger.warning('Failed to execute command: {}\n{}'. - format(' '.join(command), str(e))) + raise exceptions.UserError('Failed to execute command: {}\n{}'. + format(' '.join(command), str(e)))