From f999f85507ae94fb27aa5d882401a5ce213f352e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Wed, 9 Jan 2019 22:59:51 +0100 Subject: [PATCH] Sync permission at the end of backup --- src/yunohost/backup.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/yunohost/backup.py b/src/yunohost/backup.py index a2001458b..c22182a45 100644 --- a/src/yunohost/backup.py +++ b/src/yunohost/backup.py @@ -910,11 +910,12 @@ class RestoreManager(): service_regen_conf(names=['slapd'], force=True) migration_0009.migrate_LDAP_db(auth) - def clean(self): + def clean(self, auth): """ End a restore operations by cleaning the working directory and regenerate ssowat conf (if some apps were restored) """ + from permission import permission_sync_to_user successfull_apps = self.targets.list("apps", include=["Success", "Warning"]) @@ -923,6 +924,8 @@ class RestoreManager(): # ldap restore hooks os.system('sudo yunohost app ssowatconf') + permission_sync_to_user(auth, force=True) + if os.path.ismount(self.work_dir): ret = subprocess.call(["umount", self.work_dir]) if ret != 0: @@ -1135,7 +1138,7 @@ class RestoreManager(): self._migrate_system_if_needed(auth) self._restore_apps(auth) finally: - self.clean() + self.clean(auth) def _patch_backup_csv_file(self): """