genieparser icon indicating copy to clipboard operation
genieparser copied to clipboard

[IOS-XE] Parser for "show isis hostname" does not accommodate device hostnames with dashes

Open ChristopherJHart opened this issue 9 months ago • 4 comments

The parser for IOS-XE's show isis hostname command does not work if a device hostname contains dashes. Underscores seem to work fine.

Sample CLI output:

R5-Router#show isis hostname
Level  System ID      Dynamic Hostname  (64512)
 2     1930.0000.2001 R1_Router
 2     1920.0000.2003 R2-Router
 2     1920.0000.2002 R3_Router
 2     1920.0000.2051 R4-Router
     * 1920.0000.2053 R5-Router
 2     1920.0000.2052 R6_Router

Expected return data should include the hostnames with dashes in them. Instead, the actual (incorrect) return data only includes hostnames with underscores.

{
    'tag': {
        '64512': {
            'hostname_db': {
                'hostname': {
                    '1920.0000.2002': {
                        'hostname': 'R3_Router',
                        'level': 2,
                    },
                    '1920.0000.2052': {
                        'hostname': 'R6_Router',
                        'level': 2,
                    },
                    '1930.0000.2001': {
                        'hostname': 'R1_Router',
                        'level': 2,
                    },
                },
            },
        },
    },
}

ChristopherJHart avatar Apr 29 '24 16:04 ChristopherJHart