Skip to content

Commit

Permalink
capture stderr as well as stdout when diagnosing
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lepistone authored and sbidoul committed Nov 5, 2018
1 parent df7c6d7 commit 78a5ce8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server_environment/system_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@

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()


Expand Down

0 comments on commit 78a5ce8

Please sign in to comment.