-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Create a Python library to house common general SONiC-related APIs #4999
Labels
Comments
This was referenced Jul 18, 2020
First step toward resolving this: #5003 |
This was referenced Jul 27, 2020
jleveque
added a commit
that referenced
this issue
Aug 3, 2020
…ge (#5043) As part of consolidating all common Python-based functionality into the new sonic-py-common package, this pull request: 1. Redirects all Python applications/scripts in sonic-buildimage repo which previously imported sonic_device_util or sonic_daemon_base to instead import sonic-py-common, which was added in #5003 2. Replaces all calls to `sonic_device_util.get_platform_info()` to instead call `sonic_py_common.get_platform()` and removes any calls to `sonic_device_util.get_machine_info()` which are no longer necessary (i.e., those which were only used to pass the results to `sonic_device_util.get_platform_info()`. 3. Removes unused imports to the now-deprecated sonic-daemon-base package and sonic_device_util.py module This is the next step toward resolving #4999 Also reverted my previous change in which device_info.get_platform() would first try obtaining the platform ID string from Config DB and fall back to gathering it from machine.conf upon failure because this function is called by sonic-cfggen before the data is in the DB, in which case, the db_connect() call will hang indefinitely, which was not the behavior I expected. As of now, the function will always reference machine.conf.
jleveque
added a commit
to sonic-net/sonic-platform-common
that referenced
this issue
Aug 5, 2020
As part of consolidating all common Python-based functionality into the new sonic-py-common package, this pull request migrates from importing the sonic-daemon-base package to importing the sonic-py-common package. This is the next step toward resolving sonic-net/sonic-buildimage#4999. - Also reorganize imports for consistency
jleveque
added a commit
to sonic-net/sonic-platform-daemons
that referenced
this issue
Aug 5, 2020
As part of consolidating all common Python-based functionality into the new sonic-py-common package, this pull request migrates from importing the sonic-daemon-base package to importing the sonic-py-common package. This is the next step toward resolving sonic-net/sonic-buildimage#4999. - Also reorganize imports for consistency
jleveque
added a commit
to sonic-net/sonic-utilities
that referenced
this issue
Aug 8, 2020
…ge (#1008) As part of consolidating all common Python-based functionality into the new sonic-py-common package, this pull request redirects all Python applications/scripts in sonic-utilities repo to point to sonic-py-common and removes multiple duplicate definitions of common functions in the process. This is the next step toward resolving sonic-net/sonic-buildimage#4999. - Also reorganize imports for consistency - Also align some style
jleveque
added a commit
that referenced
this issue
Aug 13, 2020
…on package (#5132) As part of consolidating all common Python-based functionality into the new sonic-py-common package, this pull request: 1. Redirects all Python applications/scripts in sonic-buildimage repo which previously imported sonic_device_util or sonic_daemon_base to instead import sonic-py-common, which was added to the 201911 branch in #5063 2. Replaces all calls to `sonic_device_util.get_platform_info()` to instead call `sonic_py_common.get_platform()` and removes any calls to `sonic_device_util.get_machine_info()` which are no longer necessary (i.e., those which were only used to pass the results to `sonic_device_util.get_platform_info()`. 3. Removes unused imports to the now-deprecated sonic-daemon-base package and sonic_device_util.py module This is a step toward resolving #4999
jleveque
added a commit
to sonic-net/sonic-platform-daemons
that referenced
this issue
Aug 13, 2020
…ckage (#83) As part of consolidating all common Python-based functionality into the new sonic-py-common package, this pull request migrates from importing the sonic-daemon-base package to importing the sonic-py-common package. This is the next step toward resolving sonic-net/sonic-buildimage#4999. - Also reorganize imports for consistency
jleveque
added a commit
to sonic-net/sonic-utilities
that referenced
this issue
Aug 14, 2020
…on package (#1040) As part of consolidating all common Python-based functionality into the new sonic-py-common package, this pull request redirects all Python applications/scripts in sonic-utilities repo to point to sonic-py-common and removes multiple duplicate definitions of common functions in the process. This is the next step toward resolving sonic-net/sonic-buildimage#4999. - Also reorganize imports for consistency - Also align some style This is a port of #1008 to the 201911 branch
This was referenced Aug 15, 2020
santhosh-kt
pushed a commit
to santhosh-kt/sonic-buildimage
that referenced
this issue
Feb 25, 2021
…ge (sonic-net#5043) As part of consolidating all common Python-based functionality into the new sonic-py-common package, this pull request: 1. Redirects all Python applications/scripts in sonic-buildimage repo which previously imported sonic_device_util or sonic_daemon_base to instead import sonic-py-common, which was added in sonic-net#5003 2. Replaces all calls to `sonic_device_util.get_platform_info()` to instead call `sonic_py_common.get_platform()` and removes any calls to `sonic_device_util.get_machine_info()` which are no longer necessary (i.e., those which were only used to pass the results to `sonic_device_util.get_platform_info()`. 3. Removes unused imports to the now-deprecated sonic-daemon-base package and sonic_device_util.py module This is the next step toward resolving sonic-net#4999 Also reverted my previous change in which device_info.get_platform() would first try obtaining the platform ID string from Config DB and fall back to gathering it from machine.conf upon failure because this function is called by sonic-cfggen before the data is in the DB, in which case, the db_connect() call will hang indefinitely, which was not the behavior I expected. As of now, the function will always reference machine.conf.
malletvapid23
added a commit
to malletvapid23/Sonic-Utility
that referenced
this issue
Aug 3, 2023
…ge (#1008) As part of consolidating all common Python-based functionality into the new sonic-py-common package, this pull request redirects all Python applications/scripts in sonic-utilities repo to point to sonic-py-common and removes multiple duplicate definitions of common functions in the process. This is the next step toward resolving sonic-net/sonic-buildimage#4999. - Also reorganize imports for consistency - Also align some style
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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-common
package 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/20The text was updated successfully, but these errors were encountered: