Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting all json config-elements residing in config_db.json #1454

Merged
merged 1 commit into from
Mar 10, 2018

Commits on Mar 3, 2018

  1. Sorting all json config-elements residing in config_db.json

    Just a simple change to make sonic's user life a little bit easier. Displaying the multiple elements of config_db.json in an orderly fashion allows a more intuitive user-experience.
    
    For this change i'm simply intercepting the config-state that is about to be dumped to config_db.json, and i'm placing it in an ordered-dictionary, so that information is pushed to file in natural/alphanumerical ordering.
    
    Example:
    
    admin@lnos-x1-a-csw01:~$ sudo sonic-cfggen -m /etc/sonic/minigraph.xml --print-data
    {
    ...
          "PORT": {
            "Ethernet0": {
                 "alias": "Eth1/1",
                 "lanes": "65"
    },
            "Ethernet1": {
                 "alias": "Eth1/2",
                 "lanes": "66"
    },
            "Ethernet2": {
                 "alias": "Eth1/3",
                 "lanes": "67"
    },
            "Ethernet3": {
                "alias": "Eth1/4",
                "lanes": "68"
    },
            "Ethernet4": {
                 "alias": "Eth2/1",
                 "lanes": "69"
    },
    ...
    ...
        "INTERFACE": {
           "Ethernet0|10.0.0.0/31": {},
           "Ethernet1|10.0.0.2/31": {},
           "Ethernet2|10.0.0.4/31": {},
           "Ethernet3|10.0.0.6/31": {},
           "Ethernet4|10.0.0.8/31": {},
    Rodny Molina committed Mar 3, 2018
    Configuration menu
    Copy the full SHA
    4cbf12d View commit details
    Browse the repository at this point in the history