There is currently a lot of duplicated code in many SONiC repos, and other shared code is located in various packages. We need to centralize this common functionality in a Python library which resides in sonic-buildimage that we can import from sonic-daemon-base, sonic-utilities, sonic-platform-common, sonic-platform-daemons, etc., and eliminate duplicate code in the process. Examples of this functionality include:
- get_platform()
- get_hwsku
- get_path_to_platform_and_hwsku()
- get_path_to_port_config_file()
- Logging
- ...
Plan of action:
There is currently a lot of duplicated code in many SONiC repos, and other shared code is located in various packages. We need to centralize this common functionality in a Python library which resides in sonic-buildimage that we can import from sonic-daemon-base, sonic-utilities, sonic-platform-common, sonic-platform-daemons, etc., and eliminate duplicate code in the process. Examples of this functionality include:
Plan of action:
Createsonic-py-commonpackage in sonic-buildimage repoMigrate all Python applications in sonic-buildimage from sonic-daemon-base and sonic_device_util to sonic-py-commonMigrate all Python applications in submodules from sonic-daemon-base and sonic_device_util to sonic-py-commonsonic-platform-commonsonic-platform-daemonssonic-utilitiesMigrate sonic-mgmtRemove sonic-daemon-base from sonic-buildimage entirelyRemove sonic_device_util.py from sonic-buildimage entirelysonic_py_common.daemon_base(lldpmgrd, bgpcfgd, etc.)lldpmgrd: master PR merged 9/15/20caclmgrd: master PR merged 9/15/20procdockerstatsd: master PR merged 9/14/20