[IMP] tools.exec_pg_command: hide command output
authorChristophe Simonis <chs@openerp.com>
Fri, 21 Mar 2014 15:56:05 +0000 (16:56 +0100)
committerChristophe Simonis <chs@openerp.com>
Fri, 21 Mar 2014 15:56:05 +0000 (16:56 +0100)
bzr revid: chs@openerp.com-20140321155605-u96hd1da3rrrmcgg

openerp/tools/misc.py

index 2519051..bb61fe2 100644 (file)
@@ -3,7 +3,7 @@
 #
 #    OpenERP, Open Source Management Solution
 #    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
-#    Copyright (C) 2010-2013 OpenERP s.a. (<http://openerp.com>).
+#    Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
 #
 #    This program is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU Affero General Public License as
@@ -83,7 +83,8 @@ def exec_pg_command(name, *args):
         raise Exception('Couldn\'t find %s' % name)
     args2 = (prog,) + args
 
-    return subprocess.call(args2)
+    with open(os.devnull) as dn:
+        return subprocess.call(args2, stdout=dn, stderr=subprocess.STDOUT)
 
 def exec_pg_command_pipe(name, *args):
     prog = find_pg_tool(name)