diff options
-rw-r--r-- | nova/api/openstack/compute/contrib/console_output.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/nova/api/openstack/compute/contrib/console_output.py b/nova/api/openstack/compute/contrib/console_output.py index 1eb86a092..3c3a597c6 100644 --- a/nova/api/openstack/compute/contrib/console_output.py +++ b/nova/api/openstack/compute/contrib/console_output.py @@ -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} |