Skip to content

Commit

Permalink
Use get() to fetch default value from dictionary for port admin_status
Browse files Browse the repository at this point in the history
  • Loading branch information
anamehra committed Sep 20, 2022
1 parent b03cc74 commit 8ff5f37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sonic-xcvrd/xcvrd/xcvrd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ def get_port_admin_status(self, lport):
found, port_info = cfg_port_tbl.get(lport)
if found:
# Check admin_status too ...just in case
admin_status = dict(port_info)['admin_status']
admin_status = dict(port_info).get('admin_status', 'down')
return admin_status

def configure_tx_output_power(self, api, lport, tx_power):
Expand Down

0 comments on commit 8ff5f37

Please sign in to comment.