Fix for management port speed issue#2945
Merged
lguohan merged 3 commits intosonic-net:masterfrom Jun 1, 2019
sumukhatv:snmp_portspeed
Merged
Fix for management port speed issue#2945lguohan merged 3 commits intosonic-net:masterfrom sumukhatv:snmp_portspeed
lguohan merged 3 commits intosonic-net:masterfrom
sumukhatv:snmp_portspeed
Conversation
qiluo-msft
reviewed
May 25, 2019
src/sonic-config-engine/minigraph.py
Outdated
| results['MGMT_PORT'] = {} | ||
| results['MGMT_INTERFACE'] = {} | ||
| mgmt_intf_count = 0 | ||
| mgmt_speed = 0 |
Collaborator
There was a problem hiding this comment.
mgmt_speed [](start = 4, length = 10)
not used #Closed
qiluo-msft
reviewed
May 25, 2019
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 |
Collaborator
There was a problem hiding this comment.
You may combine 2 loops into one. #Closed
Contributor
Author
There was a problem hiding this comment.
Which is the other loop you are referring to?
qiluo-msft
reviewed
May 25, 2019
src/sonic-config-engine/minigraph.py
Outdated
| 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): |
Collaborator
There was a problem hiding this comment.
port_speeds_default.has_key(alias) [](start = 11, length = 34)
alias in port_speeds_default #Closed
qiluo-msft
reviewed
May 25, 2019
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} |
Collaborator
There was a problem hiding this comment.
'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
Collaborator
added 2 commits
May 29, 2019 13:17
qiluo-msft
approved these changes
May 31, 2019
lguohan
approved these changes
May 31, 2019
qiluo-msft
pushed a commit
that referenced
this pull request
Jul 4, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
- 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)