backup: fix postinstall during full restore ... tmp admin user can't be named 'admin' because of conflicting alias with the admins group

This commit is contained in:
Alexandre Aubin 2023-02-09 18:59:55 +01:00
parent a4fa6e07d0
commit 658940079d

View file

@ -940,7 +940,7 @@ class RestoreManager:
# Use a dummy password which is not gonna be saved anywhere # Use a dummy password which is not gonna be saved anywhere
# because the next thing to happen should be that a full restore of the LDAP db will happen # because the next thing to happen should be that a full restore of the LDAP db will happen
tools_postinstall(domain, "admin", "Admin", password=random_ascii(70), ignore_dyndns=True, overwrite_root_password=False) tools_postinstall(domain, "tmpadmin", "Tmp Admin", password=random_ascii(70), ignore_dyndns=True, overwrite_root_password=False)
def clean(self): def clean(self):
""" """
@ -1188,7 +1188,8 @@ class RestoreManager:
self._restore_apps() self._restore_apps()
except Exception as e: except Exception as e:
raise YunohostError( raise YunohostError(
f"The following critical error happened during restoration: {e}" f"The following critical error happened during restoration: {e}",
raw_msg=True
) )
finally: finally:
self.clean() self.clean()