Skip to content

Conversation

qiluo-msft
Copy link
Contributor

Tested in production and also manipulate unit test data to simulate this input behavior.

Signed-off-by: Qi Luo <qiluo-msft@users.noreply.github.com>
@qiluo-msft qiluo-msft requested review from tombo315, jleveque, lguohan and pavel-shirshov and removed request for tombo315 July 13, 2018 00:29
(rem_name, rem_attributes), = chassis_attributes.items()
chassis_id_subtype = str(self.ChassisIdSubtypeMap[rem_attributes['id']['type']].value)
chassis_id = rem_attributes['id']['value']
(rem_name, rem_attributes) = chassis_attributes.items()[0]
Copy link
Contributor

@pavel-shirshov pavel-shirshov Jul 13, 2018

Choose a reason for hiding this comment

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

We don't know the order in the dictionary. So [0] will not work.
It's better to check like
if 'id' In chassis_attributes.keys() #Resolved

Signed-off-by: Qi Luo <qiluo-msft@users.noreply.github.com>
@qiluo-msft qiluo-msft merged commit 94f2700 into sonic-net:master Jul 13, 2018
@qiluo-msft qiluo-msft deleted the qiluo/fix-partial branch July 13, 2018 19:01
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