Merge "Strip out characters that should be escaped from console output"

This commit is contained in:
Jenkins 2012-03-20 03:26:56 +00:00 committed by Gerrit Code Review
commit 1f1b9de4bf

View File

@ -16,6 +16,7 @@
# License for the specific language governing permissions and limitations
# under the License
import re
import webob
from nova import compute
@ -57,6 +58,10 @@ class ConsoleOutputController(wsgi.Controller):
except exception.NotFound:
raise webob.exc.HTTPNotFound(_('Instance not found'))
# XML output is not correctly escaped, so remove invalid characters
remove_re = re.compile('[\x00-\x08\x0B-\x0C\x0E-\x1F]')
output = remove_re.sub('', output)
return {'output': output}