[openstack-dev] ^M characters appearing in console output

Christopher Yeoh cyeoh at au1.ibm.com
Tue Jan 29 11:54:08 UTC 2013


Hi,

When retreiving the console output through the os-console-output API in
^M characters appear in the output. Sometimes ^M characters appear
without a corresponding linefeed character. As a side-effect this
causes the tempest test test_get_console_output to sometimes fail. This
occurs when the tests run slowly compared to a booting instance and the
console output looks like this (the tempest test has requested 10 lines
of console output):

================START====================
 WARN: /etc/rc3.d/S99-cloud-userdata failed^M
  ____ ____ ____^M
 / __/ __ ____ ____ / __ \/ __/^M
/ /__ / // __// __// /_/ /\ \ ^M
\___//_//_/ /_/ \____/___/ ^M
 http://launchpad.net/cirros^M
^M
^M^M
login as 'cirros' user. default password: 'cubswin:)'. use 'sudo' for
root.^M cirros login:
==================END================

During conversion from XML the lxml/etree module ends up converting
^M/LF characters to LF but also ^M characters by themselves are also
converted to LF. This ends up with effectively 12 lines of output and
so the test fails as it is only expecting 10 lines. The test passes if
the instance is slow to boot as the excerpts from earlier in the boot
process do not contain consecutive ^M characters.

Whilst this is fixable on the tempest side test (we can just filter
them on the client side) I'm wondering if this is the behaviour that we
expect from Nova. Firstly it is a a bit of a surprise that we are
generating ^M characters on linux booting a linux instance. Does anyone
know where these are coming from?

The console-output extension currently filters out a few characters
before passing back the console output:

        # XML output is not correctly escaped, so remove invalid
        characters remove_re =
        re.compile('[\x00-\x08\x0B-\x0C\x0E-\x1F]')

Should ^M characters be added to this list? Will this adversely affect
anyone? The extension calculates the number of lines to return based on
the the number of LF characters, not CR/LF combinations.

I've logged a bug report about this
https://bugs.launchpad.net/nova/+bug/1108820

Chris.
-- 
cyeoh at au1.ibm.com




More information about the OpenStack-dev mailing list