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

Fix for management port speed issue #2945

Merged
merged 3 commits into from
Jun 1, 2019
Merged

Fix for management port speed issue #2945

merged 3 commits into from
Jun 1, 2019

Conversation

sumukhatv
Copy link
Contributor

- 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)

@@ -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
Copy link
Collaborator

@qiluo-msft qiluo-msft May 25, 2019

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

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
Copy link
Collaborator

@qiluo-msft qiluo-msft May 25, 2019

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

Copy link
Contributor Author

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?

@@ -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):
Copy link
Collaborator

@qiluo-msft qiluo-msft May 25, 2019

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

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}
Copy link
Collaborator

@qiluo-msft qiluo-msft May 25, 2019

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

@qiluo-msft
Copy link
Collaborator

qiluo-msft commented May 25, 2019

#!/usr/bin/env python

Where is the unit test? #Closed


Refers to: src/sonic-config-engine/minigraph.py:1 in d1f04a2. [](commit_id = d1f04a2, deletion_comment = False)

Copy link
Collaborator

@qiluo-msft qiluo-msft left a comment

Choose a reason for hiding this comment

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

As comments

@lguohan lguohan merged commit 2e9b18d into sonic-net:master Jun 1, 2019
mssonicbld added a commit that referenced this pull request Nov 29, 2023
…lly (#17329)

#### Why I did it
src/sonic-swss
```
* fbab6b75 - (HEAD -> 202205, origin/202205) [Chassis][202205][orchagent] : Support WRED profiles on system ports (#2945) (9 hours ago) [vmittal-msft]
```
#### How I did it
#### How to verify it
#### Description for the changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants