From 08e7b42c82fb1ccc0c54c54f818267e0daee9bac Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 2 Feb 2021 03:57:33 +0100 Subject: [PATCH] logger.exception -> logger.error because logger.exception displays a stacktrace and it ain't relevant in any of these cases --- src/yunohost/app.py | 2 +- src/yunohost/backup.py | 6 +++--- src/yunohost/tools.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/yunohost/app.py b/src/yunohost/app.py index ade39bf20..7e2204f12 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -2174,7 +2174,7 @@ def _get_git_last_commit_hash(repository, reference='HEAD'): repository, reference), shell=True) except subprocess.CalledProcessError: - logger.exception("unable to get last commit from %s", repository) + logger.error("unable to get last commit from %s", repository) raise ValueError("Unable to get last commit with git") else: return commit.strip() diff --git a/src/yunohost/backup.py b/src/yunohost/backup.py index dbad45746..7aee5dfd1 100644 --- a/src/yunohost/backup.py +++ b/src/yunohost/backup.py @@ -700,7 +700,7 @@ class BackupManager(): except: abs_tmp_app_dir = os.path.join(self.work_dir, 'apps/', app) shutil.rmtree(abs_tmp_app_dir, ignore_errors=True) - logger.exception(m18n.n('backup_app_failed', app=app)) + logger.error(m18n.n('backup_app_failed', app=app)) self.targets.set_result("apps", app, "Error") else: # Add app info @@ -942,7 +942,7 @@ class RestoreManager(): if system_part not in self.info['system'] or\ 'paths' not in self.info['system'][system_part] or\ len(self.info['system'][system_part]['paths']) == 0: - logger.exception(m18n.n('restore_hook_unavailable', part=system_part)) + logger.error(m18n.n('restore_hook_unavailable', part=system_part)) self.targets.set_result("system", system_part, "Skipped") continue @@ -1390,7 +1390,7 @@ class RestoreManager(): env=env_dict)[0] except: msg = m18n.n('restore_app_failed', app=app_instance_name) - logger.exception(msg) + logger.error(msg) operation_logger.error(msg) if msettings.get('interface') != 'api': diff --git a/src/yunohost/tools.py b/src/yunohost/tools.py index 96bd01ed6..291c9c7b5 100644 --- a/src/yunohost/tools.py +++ b/src/yunohost/tools.py @@ -150,7 +150,7 @@ def tools_adminpw(new_password, check_strength=True): try: ldap.update("cn=admin", {"userPassword": [new_hash], }) except: - logger.exception('unable to change admin password') + logger.error('unable to change admin password') raise YunohostError('admin_password_change_failed') else: # Write as root password