Skip to content

[rfc4364]: Add extra condition to deal with init scenario#44

Closed
stcheng wants to merge 1 commit intosonic-net:masterfrom
stcheng:fix
Closed

[rfc4364]: Add extra condition to deal with init scenario#44
stcheng wants to merge 1 commit intosonic-net:masterfrom
stcheng:fix

Conversation

@stcheng
Copy link
Copy Markdown
Contributor

@stcheng stcheng commented Oct 17, 2017

When snmp subagent starts, the self.if_bpid_map is not initialized.
Add the extra condition to prevent NoneType from being iterated.

Signed-off-by: Shu0T1an ChenG shuche@microsoft.com

When snmp subagent starts, the self.if_bpid_map is not initialized.
Add the extra condition to prevent NoneType from being iterated.

Signed-off-by: Shu0T1an ChenG <shuche@microsoft.com>
Copy link
Copy Markdown
Contributor

@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 comment

# Example output: oid:0x3a000000000608
bridge_port_id = ent[b"SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID"][6:]
if bridge_port_id not in self.if_bpid_map:
if not self.if_bpid_map or bridge_port_id not in self.if_bpid_map:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we fix get_bridge_port_map to return empty dict instead of None?

@stcheng
Copy link
Copy Markdown
Contributor Author

stcheng commented Oct 17, 2017

close this pull request in favor of sonic-net/sonic-py-swsssdk#17

@stcheng stcheng closed this Oct 17, 2017
@stcheng stcheng deleted the fix branch October 17, 2017 18:37
@stcheng stcheng added the Bug label Oct 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants