From 5dc7564b4f1288dae66706fedfa86115a983e59f Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 19 Jan 2015 18:03:10 +0000 Subject: [PATCH] make init_db less verbose --- pandora/app/management/commands/init_db.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pandora/app/management/commands/init_db.py b/pandora/app/management/commands/init_db.py index 63be34ed..bdfcc107 100644 --- a/pandora/app/management/commands/init_db.py +++ b/pandora/app/management/commands/init_db.py @@ -7,17 +7,21 @@ import subprocess import sys def run(cmd): - r = subprocess.call(cmd) - if r != 0: + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout, stderr = p.communicate() + + if p.returncode != 0: + print stderr sys.exit(r) class Command(BaseCommand): """ """ - help = 'initialize pan.do/ra db' + help = 'initialize database' args = '' def handle(self, **options): + print 'initializing database...' manage_py = sys.argv[0] for cmd in [ [manage_py, 'syncdb', '--noinput'],