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

[minigraph.py] generate mandatory default port description #1

Closed
wants to merge 2 commits into from

Conversation

mykolaf
Copy link
Owner

@mykolaf mykolaf commented Dec 14, 2018

Signed-off-by: Mykola Faryma mykolaf@mellanox.com

- What I did
Add logic to always generate port description for PORT. The goal is to provide the description in one place for snmp, lldp and user. (previously lldpmgr generated its own port description)
- How I did it
The logic is the following:
If the port description is specified in port_config.ini - use it.
If the minigraph has info about the neighbor for this port - create description in form "{neighbor_host}:{neighbor_port}"
Else assign default - " ".
- How to verify it
sonic-cfggen -m /etc/sonic/minigraph.xml -p /usr/share/sonic/device/x86_64-mlnx_msn2100-r0/ACS-MSN2100/port_config.ini --print-data

port_config.ini

# name          lanes         speed description
Ethernet0       0             10000   q
Ethernet1       1             10000
Ethernet2       2             10000   w
Result :
    "PORT": {
        "Ethernet0": {
            "lanes": "0",
            "alias": "Ethernet0",
            "speed": "10000",
            "description": "q",
            "mtu": "9100"
        },
        "Ethernet1": {
            "lanes": "1",
            "description": "Servers0:eth0",
            "mtu": "9100",
            "alias": "Ethernet1",
            "admin_status": "up",
            "speed": "10000"
        },
        "Ethernet2": {
            "lanes": "2",
            "description": "w",
            "mtu": "9100",
            "alias": "Ethernet2",
            "admin_status": "up",
            "speed": "10000"
 . . .
        "Ethernet36": {
            "lanes": "36,37,38,39",
            "description": "ARISTA04T1:Ethernet1",
            "mtu": "9100",
            "alias": "Ethernet36",
            "admin_status": "up",
            "speed": "50000"
        },
        "Ethernet40": {
            "alias": "Ethernet40",
            "lanes": "40,41,42,43",
            "description": " ",
            "speed": "40000",
            "mtu": "9100"
        }

- Description for the changelog

generate mandatory default port description

- A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: Mykola Faryma <mykolaf@mellanox.com>
except KeyError:
pass
# if no meaningful description available, set to default (a space)
port.setdefault('description', ' ')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

""?

@mykolaf mykolaf closed this Dec 21, 2018
mykolaf pushed a commit that referenced this pull request May 22, 2019
…c-net#2832)

* Base DHCP relay Docker image on Strech base Docker

* Change URL for isc-dhcp source repository

* Upgrade isc-dhcp source branch to 4.3.5-3.1

* Update patch #1 to apply to isc-dhcp 4.3.5-3.1

* Update patch #2 to apply to isc-dhcp 4.3.5-3.1

* Update patch #3 to apply to isc-dhcp 4.3.5-3.1

* Update patch #4 to apply to isc-dhcp 4.3.5-3.1

* Remove security patches, as they are now applied as part of 4.3.5-3.1 source

* Reorder patches to apply bug fix first, then features

* Extend makefile to build debug Docker image

* Update commit that series file applies against
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants