summaryrefslogtreecommitdiff
path: root/service/pixelated/config
diff options
context:
space:
mode:
authorFolker Bernitt <fbernitt@thoughtworks.com>2015-09-25 17:30:00 +0200
committerFolker Bernitt <fbernitt@thoughtworks.com>2015-09-25 17:30:00 +0200
commit6eba069fdb566fd006fa48b8b9c5d5b44085f524 (patch)
treef2b4e5f58db35c659b33095b331905a5d282ed5b /service/pixelated/config
parentcbf8c2208da4e2cf9f4ae9d5551b0ceaa1de4ea9 (diff)
Add repair to pixelated maintenance
- Issue #468 - Call with: pixelated-maintenance repair
Diffstat (limited to 'service/pixelated/config')
-rw-r--r--service/pixelated/config/arguments.py1
-rw-r--r--service/pixelated/config/leap.py6
2 files changed, 5 insertions, 2 deletions
diff --git a/service/pixelated/config/arguments.py b/service/pixelated/config/arguments.py
index fa7fdae4..7a7abe49 100644
--- a/service/pixelated/config/arguments.py
+++ b/service/pixelated/config/arguments.py
@@ -43,6 +43,7 @@ def parse_maintenance_args():
subparsers.add_parser('dump-soledad', help='dump the soledad database')
subparsers.add_parser('sync', help='sync the soledad database')
+ subparsers.add_parser('repair', help='repair database if possible')
return parser.parse_args()
diff --git a/service/pixelated/config/leap.py b/service/pixelated/config/leap.py
index c1280756..4dcb18f4 100644
--- a/service/pixelated/config/leap.py
+++ b/service/pixelated/config/leap.py
@@ -13,7 +13,8 @@ def initialize_leap(leap_provider_cert,
leap_provider_cert_fingerprint,
credentials_file,
organization_mode,
- leap_home):
+ leap_home,
+ initial_sync=True):
init_monkeypatches()
events_server.ensure_server()
provider, username, password = credentials.read(organization_mode, credentials_file)
@@ -24,7 +25,8 @@ def initialize_leap(leap_provider_cert,
LeapCertificate(provider).setup_ca_bundle()
leap_session = LeapSessionFactory(provider).create(username, password)
- leap_session = yield leap_session.initial_sync()
+ if initial_sync:
+ leap_session = yield leap_session.initial_sync()
defer.returnValue(leap_session)