Skip to content

Commit

Permalink
ignore stderr of pcsd-cli.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjelinek committed Jan 12, 2017
1 parent c8ab3c8 commit 03f17f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
- Fixed disabling services on systemd systems when using instances
([rhbz#1389501])
- Fixed parsing commandline options ([rhbz#1404229])
- Pcs does not exit with a false error message anymore when pcsd-cli.rb outputs
to stderr ([ghissue#124])

[ghissue#124]: https://github.com/ClusterLabs/pcs/issues/124
[ghpull#119]: https://github.com/ClusterLabs/pcs/pull/119
[ghpull#120]: https://github.com/ClusterLabs/pcs/pull/120
[rhbz#1261116]: https://bugzilla.redhat.com/show_bug.cgi?id=1261116
Expand Down
10 changes: 5 additions & 5 deletions pcs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -979,20 +979,20 @@ def run_pcsdcli(command, data=None):
pcsdcli_path = os.path.join(pcsd_dir_path, 'pcsd-cli.rb')
gem_home = os.path.join(pcsd_dir_path, 'vendor/bundle/ruby')
env_var["GEM_HOME"] = gem_home
output, retval = run(
stdout, dummy_stderr, retval = cmd_runner().run(
["/usr/bin/ruby", "-I" + pcsd_dir_path, pcsdcli_path, command],
string_for_stdin=json.dumps(data),
env_extend=env_var
json.dumps(data),
env_var
)
try:
output_json = json.loads(output)
output_json = json.loads(stdout)
for key in ['status', 'text', 'data']:
if key not in output_json:
output_json[key] = None
except ValueError:
output_json = {
'status': 'bad_json_output',
'text': output,
'text': stdout,
'data': None,
}
return output_json, retval
Expand Down

0 comments on commit 03f17f8

Please sign in to comment.