Page MenuHomePhabricator

Inconsistant leveling output from json printout
Open, Requires assessmentPublicBUG

Description

When displaying all interfaces as json the output from the json printout is referenced to showing all children of the interface dub-mode

[edit]
vyos@vyos# show int | json
{
    "ethernet": {
        "eth0": {
            "address": "10.10.10.10/24"
        }
    },
    "loopback": {
        "lo": {}
    }
}

When displaying a tag node eg. all ethernet interfaces this is different and the output is referenced to the ethernet-block itself (same reference level as in "show int" ) and not the the children inside it

[edit]
vyos@vyos# show int eth | json
{
    "ethernet": {
        "eth0": {
            "address": "10.10.10.10/24"
        }
    }
}

When displaying a single tag in the tag node this again is back to showing all children, this is the same as done in "show int"

[edit]
vyos@vyos# show int eth eth0 | json
{
    "address": "10.10.10.10/24"
}

Is this api inconsistency a symptom of the old cli interpreting done from the show command, or is it this a bug in the json interpreter?

Details

Difficulty level
Unknown (require assessment)
Version
vyos-1.2-rolling-201910310217
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible

Event Timeline

runar created this task.Thu, Oct 31, 10:12 AM

To fix this inconsistancy the output of show int ethernet | json should be:

{
       "eth0": {
            "address": "10.10.10.10/24"
        }
}
pasik added a subscriber: pasik.Mon, Nov 4, 9:52 AM