Sanitize command output in ohai-solo system info
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| satori |
Medium
|
BK Box |
Bug Description
Paramiko has issues with parsing stdout of a command on some fedora based distros when there is something printed to the screen and an interactive session. This causes an issue with ohai-solo and parsing the returned JSON document since the beginning of the output is not JSON.
For example, when the .bashrc file contains something like the following:
echo "G'day!"
the output of ohai-solo returned from Paramiko would be:
G'day!
{ "system_info": "some_json" }
The call `json.loads()` against that string will raise an exception.
Expected behavior:
Find the valid JSON in the string (if any), pull it out, and try to parse that.
Changed in satori: | |
status: | New → In Progress |
Reviewed: https:/
Committed: https:/
Submitter: Jenkins
Branch: master
commit 0258742b74ff68c
Author: BK Box <email address hidden>
Date: Wed Mar 19 15:42:01 2014 -0500
Pull out JSON string from stdout
When there is a custom message in `.bashrc` on certain fedora based
distros, the string will be included in the stdout. This will pull out
the following JSON string, if present, and attempt to parse that.
Change-Id: I7d0d4e9b369246
Closes-Bug: #1294851
Changed in satori: | |
status: | In Progress → Fix Committed |
Changed in satori: | |
status: | Fix Committed → Fix Released |
Changed in satori: | |
milestone: | none → poc |
Fix proposed to branch: master /review. openstack. org/81626
Review: https:/