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 grindtildeath committed Oct 11, 2019
1 parent 7fef970 commit 1dd6f0f
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 1dd6f0f

Please sign in to comment.