Page MenuHomeVyOS Platform

vymgmt unparsable output
Closed, ResolvedPublicBUG

Description

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.

Details

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

Event Timeline

nwsnate created this task.May 5 2020, 3:29 AM
nwsnate updated the task description. (Show Details)May 5 2020, 3:31 AM

Example of output containing control characters.

pasik added a subscriber: pasik.May 5 2020, 7:50 AM
jjakob added a subscriber: jjakob.May 5 2020, 8:05 AM

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

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

http://ascii-table.com/ansi-escape-sequences-vt-100.php

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

dmbaturin closed this task as Resolved.Aug 20 2020, 3:33 PM