Page MenuHomeVyOS Platform

vymgmt unparsable output
Closed, ResolvedPublicBUG


Output from vymgmt is unusable for parsing due to extra ascii characters in the output. These control characters are normally interpreted by the terminal and displayed without a problem, but when using vymgmt for scripts that later parse the output, these characters make it impossible to parse.

In the example below, the raw string of the output variable contains extra characters. When printing this to the console however, it works great.


Difficulty level
Unknown (require assessment)
vymgmt 0.1
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)

Event Timeline

Example of output containing control characters.

It seems to be reading the output of something that thinks it's talking to a VT100 terminal.

\r\n		CR LF
\x1b [ ? 1 h	ESC [ 1 h (Set cursor key to application DECCKM)
\x1b=		ESC = (Set alternate keypad mode DECKPAM)

This is probably related to why I see the ifconfig scripts writing ^@ to interface alias - ^@ is ASCII NUL. Touch /tmp/vyos.ifconfig.debug, commit a interface and you'll see it.

ack - I will change this to make sure it is safe !

It appears the patch doesn't fully account for all possible characters:

bgp summary\r\n\x1b[?1h\x1b=\r\x1b[m\r\nIPv4