Skip to content
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

[sensors] sensor_facts library is not Python 3 compatible #4514

Closed
alexrallen opened this issue Oct 19, 2021 · 1 comment · Fixed by #4612
Closed

[sensors] sensor_facts library is not Python 3 compatible #4514

alexrallen opened this issue Oct 19, 2021 · 1 comment · Fixed by #4612

Comments

@alexrallen
Copy link
Contributor

Description
The sensor_facts ansible library treats the output of Popen.communicate() as a string but it is now a bytes array in Python 3.

See here for details: https://docs.python.org/3/library/subprocess.html#subprocess.Popen.communicate

Steps to reproduce the issue:

  1. Run the test_sensors test

Describe the results you received:
Test fails during collection of sensor facts from ansible with TypeError: expected bytes-like object, not str

Describe the results you expected:
Test succeeds.

Note: This failure only occurs on images where Python 3 is the default interpreter such as the bullseye builds

@alexrallen
Copy link
Contributor Author

@saiarcot895 FYI

saiarcot895 added a commit to saiarcot895/sonic-mgmt that referenced this issue Nov 2, 2021
Fixes sonic-net#4514

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
saiarcot895 added a commit that referenced this issue Nov 2, 2021
Fixes #4514

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants