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

[202205] Update xcvrd to use new STATE_DB FAST_REBOOT entry #343

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sonic-xcvrd/xcvrd/xcvrd.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,12 +923,12 @@ def init_port_sfp_status_tbl(port_mapping, xcvr_table_helper, stop_event=threadi
def is_fast_reboot_enabled():
fastboot_enabled = False
state_db_host = daemon_base.db_connect("STATE_DB")
fastboot_tbl = swsscommon.Table(state_db_host, 'FAST_REBOOT')
fastboot_tbl = swsscommon.Table(state_db_host, 'FAST_RESTART_ENABLE_TABLE')
keys = fastboot_tbl.getKeys()

if "system" in keys:
output = subprocess.check_output('sonic-db-cli STATE_DB get "FAST_REBOOT|system"', shell=True, universal_newlines=True)
if "1" in output:
output = subprocess.check_output(['sonic-db-cli', 'STATE_DB', 'hget', "FAST_RESTART_ENABLE_TABLE|system", 'enable'], universal_newlines=True)
arfeigin marked this conversation as resolved.
Show resolved Hide resolved
if "true" in output:
fastboot_enabled = True

return fastboot_enabled
Expand Down