Log directory path for exceptions

Improve the log message of setup_file_sftp_userdir to include the path that
has been attempted to create.
This commit is contained in:
Jan Dittberner 2016-09-25 16:33:02 +02:00
parent 4eb3a1c3f3
commit d5a275dbbe

View file

@ -100,7 +100,8 @@ def setup_file_sftp_userdir(username, *args, **kwargs):
sftp_directory], stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as cpe:
log_and_raise(
cpe, 'could not create SFTP directory for user %s', username)
cpe, 'could not create SFTP directory %s for user %s',
sftp_directory, username)
_LOGGER.info(
'created sftp directory %s for user %s', sftp_directory, username)
return {'username': username, 'sftp_directory': sftp_directory}