-
Notifications
You must be signed in to change notification settings - Fork 0
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
[python3] Support python3 for mellanox sonic platform API and pmon related makefiles #42
Conversation
…upport in make rules
… it python2 and python3 compatible
…ding to API version
Conflicts: dockers/docker-platform-monitor/docker_init.sh platform/mellanox/mlnx-platform-api/sonic_platform/eeprom.py rules/docker-platform-monitor.mk rules/sonic-ledd.mk rules/sonic-psud.mk rules/sonic-syseepromd.mk rules/sonic-thermalctld.mk rules/sonic-xcvrd.mk slave.mk
{% endif %} | ||
|
||
{% if not skip_syseepromd %} | ||
[program:syseepromd] | ||
command=/usr/local/bin/syseepromd | ||
command={% if API_VERSION == 3 and 'syseepromd' in python3_daemons %}python3 {% else %} python2 {% endif %}/usr/local/bin/syseepromd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if python3_daemons is not defined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a test. If python3_daemons is not defined, the code 'syseepromd' in python3_daemons
returns False. So it works as expect.
|
||
except ImportError as e: | ||
raise ImportError (str(e) + "- required module not found") | ||
|
||
try: | ||
# python_sdk_api does not support python3 for now, for python3, catch the ImportError | ||
# and ignore it here. Meanwhile, we have to trigger xcvrd using python2 now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comment: daemons such as thermalctld will also import this file, so need to catch the ImportError here.
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PSUD_PY2) | ||
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_SYSEEPROMD_PY2) | ||
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_THERMALCTLD_PY2) | ||
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_XCVRD_PY2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if SONIC_XCVRD_PY2 is not provided?
457e94d51 [macsec_linux]: Fixbug cannot dump the PN due to type error (#42) f7c073323 Disable P2P module (#41) 7b3b777e2 [ci]: use native arm64 and armhf build pool (#40) d4e91d66c [sonic_operator]: Increase wait timeout (#39) 43611ef88e [sonic_operators]: Add log in sonic operators (#43) Signed-off-by: Ze Gan <[email protected]>
…face (sonic-net#15881) sonic-build image side change to fix source interface selection in dual tor scenario. dhcprelay related PR: [master]fix dhcpv6 relay dual tor source interface selection issue sonic-dhcp-relay#42 Announce dhcprelay submodule to 6a6ce24 to include PR #42
…ly (sonic-net#18097) #### Why I did it src/sonic-ztp ``` * 56cebae - (HEAD -> master, origin/master, origin/HEAD) Enhancements to allow custom umask usage while executing plugins (#42) (2 hours ago) [rajendra-dendukuri] ``` #### How I did it #### How to verify it #### Description for the changelog
- Why I did it
python2 is end of life and SONiC is going to support python3. This PR is going to support:
- How I did it
- How to verify it
- Which release branch to backport (provide reason below if selected)
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)