Skip to content

Commit 8ff5f37

Browse files
authored
Use get() to fetch default value from dictionary for port admin_status #286
Fixes #11707
1 parent b03cc74 commit 8ff5f37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sonic-xcvrd/xcvrd/xcvrd.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,7 @@ def get_port_admin_status(self, lport):
12501250
found, port_info = cfg_port_tbl.get(lport)
12511251
if found:
12521252
# Check admin_status too ...just in case
1253-
admin_status = dict(port_info)['admin_status']
1253+
admin_status = dict(port_info).get('admin_status', 'down')
12541254
return admin_status
12551255

12561256
def configure_tx_output_power(self, api, lport, tx_power):

0 commit comments

Comments
 (0)