gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-bank] branch master updated: Catching "db not found"


From: gnunet
Subject: [GNUnet-SVN] [taler-bank] branch master updated: Catching "db not found" error from the launcher.
Date: Sat, 23 Dec 2017 11:47:20 +0100

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository bank.

The following commit(s) were added to refs/heads/master by this push:
     new 64d9a87  Catching "db not found" error from the launcher.
64d9a87 is described below

commit 64d9a879da628bbd9a78aba368641224b60ab9cf
Author: Marcello Stanisci <address@hidden>
AuthorDate: Sat Dec 23 11:46:39 2017 +0100

    Catching "db not found" error from the launcher.
---
 taler-bank-manage.in | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/taler-bank-manage.in b/taler-bank-manage.in
index df83042..ca7a237 100644
--- a/taler-bank-manage.in
+++ b/taler-bank-manage.in
@@ -6,11 +6,13 @@ the GNU Taler bank.
 """
 
 import argparse
+import django
 import sys
 import os
 import site
 import logging
 from talerbank.talerconfig import TalerConfig
+from django.core.management import call_command
 
 os.environ.setdefault("TALER_PREFIX", "@prefix@")
 site.addsitedir("%s/lib/python%d.%d/site-packages" % (
@@ -25,9 +27,7 @@ TC = 
TalerConfig.from_file(os.environ.get("TALER_CONFIG_FILE"))
 UWSGI_LOGFMT = "%(ltime) %(proto) %(method) %(uri) %(proto) => %(status)"
 
 def handle_django(args):
-    import django
     django.setup()
-    from django.core.management import call_command
     # always run 'migrate' first, in case a virgin db is being used.
     call_command('migrate')
     from django.core.management import execute_from_command_line
@@ -37,7 +37,6 @@ def handle_django(args):
 def handle_serve_http(args):
     import django
     django.setup()
-    from django.core.management import call_command
     call_command('migrate')
     call_command('provide_accounts')
     call_command('check')
@@ -57,9 +56,7 @@ def handle_serve_http(args):
 
 def handle_serve_uwsgi(args):
     del args # pacify PEP checkers
-    import django
     django.setup()
-    from django.core.management import call_command
     call_command('migrate')
     call_command('provide_accounts')
     call_command('check')
@@ -83,9 +80,7 @@ def handle_serve_uwsgi(args):
     os.execlp(*params)
 
 def handle_sampledata():
-    import django
     django.setup()
-    from django.core.management import call_command
     call_command('sample_donations')
 
 def handle_config(args):
@@ -132,4 +127,7 @@ if getattr(ARGS, 'func', None) is None:
 if ARGS.config is not None:
     os.environ["TALER_CONFIG_FILE"] = ARGS.config
 
-ARGS.func(ARGS)
+try:
+    ARGS.func(ARGS)
+except django.db.utils.OperationalError:
+    LOGGER.error("Your database has serious problems. Does it exist?")

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]