Skip to content

Fix: No explicit reading ConfigDB in get_asic_conf_file_path()#10723

Merged
qiluo-msft merged 6 commits intosonic-net:masterfrom
qiluo-msft:qiluo/nonconfigdb
May 6, 2022
Merged

Fix: No explicit reading ConfigDB in get_asic_conf_file_path()#10723
qiluo-msft merged 6 commits intosonic-net:masterfrom
qiluo-msft:qiluo/nonconfigdb

Conversation

@qiluo-msft
Copy link
Copy Markdown
Collaborator

Why I did it

This function is critical for is_multi_asic() and SonicDBConfig initializing. No explicit reading ConfigDB. Otherwise it will implicitly trigger SonicDBConfig initializing.

How I did it

  1. No explicit reading ConfigDB in get_asic_conf_file_path()
  2. Collect asic_conf_path_candidates lazily to prevent any unnecessary side effect and improve the performance

How to verify it

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented May 1, 2022

This pull request introduces 2 alerts when merging 42dfa75 into 80f5d36 - view on LGTM.com

new alerts:

  • 2 for Unused import

@qiluo-msft qiluo-msft marked this pull request as ready for review May 2, 2022 22:41
@qiluo-msft qiluo-msft requested a review from lguohan as a code owner May 2, 2022 22:41
Copy link
Copy Markdown
Contributor

@arlakshm arlakshm left a comment

Choose a reason for hiding this comment

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

lgtm

@qiluo-msft qiluo-msft merged commit 45c5ca0 into sonic-net:master May 6, 2022
@qiluo-msft qiluo-msft deleted the qiluo/nonconfigdb branch May 6, 2022 21:22
liushilongbuaa pushed a commit to liushilongbuaa/sonic-buildimage that referenced this pull request Jun 20, 2022
…-net#10723)

#### Why I did it
This function is critical for is_multi_asic() and SonicDBConfig initializing. No explicit reading ConfigDB. Otherwise it will implicitly trigger SonicDBConfig initializing.

#### How I did it
1. No explicit reading ConfigDB in get_asic_conf_file_path()
2. Collect asic_conf_path_candidates lazily to prevent any unnecessary side effect and improve the performance
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.

2 participants