From 4849e004e56f4e5fbde0fb188848395c3e6a5767 Mon Sep 17 00:00:00 2001 From: Andre Anjos <andre.anjos@idiap.ch> Date: Fri, 24 Jun 2016 16:46:26 +0200 Subject: [PATCH] [utils] Handle backup and re-store of optional apps in a better way --- beat/web/utils/management/commands/backup.py | 1 + beat/web/utils/management/commands/restore.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/beat/web/utils/management/commands/backup.py b/beat/web/utils/management/commands/backup.py index 749e1dc4e..5df5374de 100644 --- a/beat/web/utils/management/commands/backup.py +++ b/beat/web/utils/management/commands/backup.py @@ -59,6 +59,7 @@ APPS = [ #dump and load order are respected 'search', 'reports', 'actstream', + 'post_office', ] diff --git a/beat/web/utils/management/commands/restore.py b/beat/web/utils/management/commands/restore.py index 1efcf29f2..e743eb4b1 100644 --- a/beat/web/utils/management/commands/restore.py +++ b/beat/web/utils/management/commands/restore.py @@ -74,6 +74,10 @@ class Command(BaseCommand): def add_arguments(self, parser): + parser.add_argument('-e', '--exclude', dest='exclude', action='append', + default=[], help='An app_label to exclude (use multiple ' \ + '--exclude to exclude multiple apps).') + parser.add_argument('backup', type=str, help='The backup you wish to restore from') @@ -115,6 +119,7 @@ class Command(BaseCommand): # and loads the apps respecting the imposed order for app in APPS: + if app in arguments.get('exclude'): continue # copy prefix data path = os.path.join(settings.PREFIX, app) srcdir = os.path.join(tmpdir, 'prefix', app) -- GitLab