capture stderr as well as stdout when diagnosing

This fixes OCA/server-tools#125 because in some Ubuntu systems
lsb_release outputs to stderr as well as stdout. This message will be
printed to console, not logged nor shown among server infomation. That
way the message is lost and only pollutes unit tests output.
This commit is contained in:
Leonardo Pistone 2015-02-05 16:31:37 +01:00 committed by Stéphane Bidoul (ACSONE)
parent df7c6d74f7
commit 78a5ce87af
No known key found for this signature in database
GPG Key ID: BCAB2555446B5B92
1 changed files with 2 additions and 1 deletions

View File

@ -30,7 +30,8 @@ from openerp.tools.config import config
def _get_output(cmd):
bindir = config['root_path']
p = subprocess.Popen(cmd, shell=True, cwd=bindir, stdout=subprocess.PIPE)
p = subprocess.Popen(cmd, shell=True, cwd=bindir, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
return p.communicate()[0].rstrip()