Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[config] Eliminate port breakout-related globals (sonic-net#1045)
Port breakout-related data should be gathered on-demand, not every time `config` is executed. If the ConfigDB is not ready, the call to get hwsku will hang indefinitely, which will occur when loading config for the first time. Also, if it fails to retrieve the port breakout globals, it will abort, even if the executed command was unrelated to port breakout. This is not desirable behavior. This PR eliminates port breakout-related global variables, and encapsulates them in functions to be called on-demand, only when commands which require the data are executed. It is currently only accessed in two places. If we feel the need to cache it in the future for efficiency, we can look into adding it to the Click context. Also rename `_get_option()` to `_get_breakout_cfg_file_name()` to add more detail.
- Loading branch information