-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fix for management port speed issue #2945
Conversation
src/sonic-config-engine/minigraph.py
Outdated
@@ -484,6 +493,7 @@ def parse_xml(filename, platform=None, port_config_file=None): | |||
results['MGMT_PORT'] = {} | |||
results['MGMT_INTERFACE'] = {} | |||
mgmt_intf_count = 0 | |||
mgmt_speed = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mgmt_speed [](start = 4, length = 10)
not used #Closed
src/sonic-config-engine/minigraph.py
Outdated
desc = interface.find(str(QName(ns, "Description"))) | ||
if desc != None: | ||
port_descriptions[port_alias_map.get(alias, alias)] = desc.text | ||
port_speeds[port_alias_map.get(alias, alias)] = speed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may combine 2 loops into one. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which is the other loop you are referring to?
src/sonic-config-engine/minigraph.py
Outdated
@@ -493,7 +503,11 @@ def parse_xml(filename, platform=None, port_config_file=None): | |||
name = 'eth' + str(mgmt_intf_count) | |||
mgmt_intf_count += 1 | |||
mgmt_alias_reverse_mapping[alias] = name | |||
results['MGMT_PORT'][name] = {'alias': alias, 'admin_status': 'up'} | |||
if port_speeds_default.has_key(alias): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
port_speeds_default.has_key(alias) [](start = 11, length = 34)
alias in port_speeds_default
#Closed
src/sonic-config-engine/minigraph.py
Outdated
results['MGMT_PORT'][name] = {'alias': alias, 'admin_status': 'up'} | ||
if port_speeds_default.has_key(alias): | ||
port_speed = port_speeds_default[alias] | ||
results['MGMT_PORT'][name] = {'alias': alias, 'admin_status': 'up', 'speed': port_speed} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'speed': port_speed} [](start = 80, length = 20)
suggest append it conditionally. if we have more optional field, the if-else doesn't work well. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As comments
- What I did
Fixed the SNMP port speed missing issue.
- How I did it
Port speed was not being updated in the Config DB. Made changes to the minigraph parser to obtain the management port speed information from the minigraph. Now that the parser will return this information to the config-engine, which will be updated in the Config DB.
- How to verify it
Check the config DB for the changes in the MGMT_PORT key. It should then contain speed value as well.
- Description for the changelog
I added the logic to lookup for the ManagementInterface section in the minigraph xml file and add this to the dictionary object returned by parse_xml method in the minigraph.py module
- A picture of a cute animal (not mandatory but encouraged)