From 7dbb51da1a2d61e7ef137beebbb9a7e35b817c03 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Thu, 29 Jan 2015 22:39:01 +0100 Subject: [PATCH] add logging for set_file_ssh_authorized_keys --- gvafile/fileservertasks/tasks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gvafile/fileservertasks/tasks.py b/gvafile/fileservertasks/tasks.py index fecba37..3bbbbc4 100644 --- a/gvafile/fileservertasks/tasks.py +++ b/gvafile/fileservertasks/tasks.py @@ -336,6 +336,8 @@ def set_file_ssh_authorized_keys(username, ssh_keys): stderr=subprocess.STDOUT) subprocess.check_output([ SUDO_CMD, RM_CMD, filename], stderr=subprocess.STDOUT) + _LOGGER.info( + 'set %d authorized_keys for user %s', len(ssh_keys), username) except subprocess.CalledProcessError as cpe: log_and_raise( cpe, 'could not write authorized_keys file for user %s', @@ -346,6 +348,8 @@ def set_file_ssh_authorized_keys(username, ssh_keys): SUDO_CMD, RM_CMD, '-rf', os.path.dirname(ssh_authorized_keys_file)], stderr=subprocess.STDOUT) + _LOGGER.info( + 'deleted authorized_keys of user %s', username) except subprocess.CalledProcessError as cpe: log_and_raise( cpe, 'could not remove the authorized_keys file of user %s',