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#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 TDu committed Nov 13, 2017
1 parent 0be8eab commit c5feeed
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 c5feeed

Please sign in to comment.