Restore workflow done

This commit is contained in:
Spitap
2022-07-26 12:07:42 +02:00
parent 439ffb94c4
commit 15768c429e
8 changed files with 89 additions and 2 deletions

View File

@@ -25,6 +25,14 @@ class Spamassassin(base.Installer):
def get_sql_schema_path(self):
"""Return SQL schema."""
if self.restore:
utils.printcolor("Trying to restore spamassassin database from backup", utils.MAGENTA)
amavisDbBackupPath = self.restore + "databases/spamassassin.sql"
if os.path.isfile(amavisDbBackupPath):
utils.printcolor("Spamassassin database backup found ! Restoring...", utils.GREEN)
return amavisDbBackupPath
utils.printcolor("Spamassassin database backup not found, creating empty database", utils.RED)
if self.dbengine == "postgres":
fname = "bayes_pg.sql"
else: