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

Update PDDF utils and common platform APIs for Debian Bullseye #9585

Merged
merged 2 commits into from
Jan 3, 2022

Conversation

FuzailBrcm
Copy link
Contributor

Why I did it

  • PDDF utils were python2 compliant and they needed to be migrated to Python3 (as per Bullseye)
  • PDDF common platform APIs file name changed as the name was already in use
  • Indentation issues
  • Dead/redundant code needed to be removed

How I did it

  • Made files Python3 compliant
  • Indentation corrected
  • Redundant code removed

How to verify it

AS7326 Accton platform uses PDDF. PDDF utils were run on this platform to verify.

root@sonic:/home/admin# pddf_psuutil mfrinfo
PSU    Status    Manufacturer ID    Model     Serial              Fan Airflow Direction
-----  --------  -----------------  --------  ------------------  -----------------------
PSU1   NOT OK
PSU2   OK        3Y POWER           YM-2651Y  SA070V581836002372  EXHAUST
root@sonic:/home/admin# pddf_psuutil seninfo
PSU    Status      Output Voltage (V)    Output Current (A)    Output Power (W)    Temperature1 (C)    Fan1 Speed (RPM)
-----  --------  --------------------  --------------------  ------------------  ------------------  ------------------
PSU1   NOT OK                    0.00                  0.00                0.00                0.00                   0
PSU2   OK                       12.03                  8.03               96.00               24.00                6400
root@sonic:/home/admin# pddf_psuutil status
PSU    Status
-----  --------
PSU1   NOT OK
PSU2   OK
root@sonic:/home/admin# pddf_psuutil numpsus
2
root@sonic:/home/admin#
root@sonic:/home/admin#
root@sonic:/home/admin# pddf_fanutil numfans
12
root@sonic:/home/admin# pddf_fanutil status
FAN         Status
----------  --------
Fantray1_1  OK
Fantray1_2  OK
Fantray2_1  OK
Fantray2_2  OK
Fantray3_1  OK
Fantray3_2  OK
Fantray4_1  OK
Fantray4_2  OK
Fantray5_1  OK
Fantray5_2  OK
Fantray6_1  OK
Fantray6_2  OK
root@sonic:/home/admin# pddf_fanutil direction
FAN         Direction
----------  -----------
Fantray1_1  Exhaust
Fantray1_2  Exhaust
Fantray2_1  Exhaust
Fantray2_2  Exhaust
Fantray3_1  Exhaust
Fantray3_2  Exhaust
Fantray4_1  Exhaust
Fantray4_2  Exhaust
Fantray5_1  Exhaust
Fantray5_2  Exhaust
Fantray6_1  Exhaust
Fantray6_2  Exhaust
root@sonic:/home/admin# pddf_fanutil getspeed
FAN           SPEED (RPM)
----------  -------------
Fantray1_1          10800
Fantray1_2           9700
Fantray2_1          10800
Fantray2_2           9800
Fantray3_1          10800
Fantray3_2           9900
Fantray4_1          11000
Fantray4_2          10000
Fantray5_1          10900
Fantray5_2           9900
Fantray6_1          10900
Fantray6_2           9800
root@sonic:/home/admin# pddf_fanutil direction
FAN         Direction
----------  -----------
Fantray1_1  Exhaust
Fantray1_2  Exhaust
Fantray2_1  Exhaust
Fantray2_2  Exhaust
Fantray3_1  Exhaust
Fantray3_2  Exhaust
Fantray4_1  Exhaust
Fantray4_2  Exhaust
Fantray5_1  Exhaust
Fantray5_2  Exhaust
Fantray6_1  Exhaust
Fantray6_2  Exhaust
root@sonic:/home/admin# pddf_fanutil setspeed 100
Successful
root@sonic:/home/admin# pddf_fanutil getspeed
FAN           SPEED (RPM)
----------  -------------
Fantray1_1          22100
Fantray1_2          19400
Fantray2_1          22000
Fantray2_2          19100
Fantray3_1          22300
Fantray3_2          19000
Fantray4_1          21800
Fantray4_2          19400
Fantray5_1          22200
Fantray5_2          19100
Fantray6_1          22100
Fantray6_2          19100
root@sonic:/home/admin#
root@sonic:/home/admin# pddf_fanutil debug dump-sysfs
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan1_present
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan2_present
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan3_present
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan4_present
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan5_present
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan6_present
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan7_present
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan8_present
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan9_present
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan10_present
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan11_present
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan12_present
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan1_direction
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan2_direction
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan3_direction
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan4_direction
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan5_direction
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan6_direction
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan7_direction
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan8_direction
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan9_direction
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan10_direction
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan11_direction
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan12_direction
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan1_input
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan2_input
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan3_input
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan4_input
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan5_input
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan6_input
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan7_input
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan8_input
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan9_input
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan10_input
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan11_input
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan12_input
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan1_pwm
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan2_pwm
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan3_pwm
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan4_pwm
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan5_pwm
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan6_pwm
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan7_pwm
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan8_pwm
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan9_pwm
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan10_pwm
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan11_pwm
/sys/bus/i2c/devices/i2c-0/i2c-1/i2c-11/11-0066/fan12_pwm
root@sonic:/home/admin#
root@sonic:/home/admin# pddf_ledutil setstatusled LOC_LED STATUS_LED_COLOR_AMBER
True
root@sonic:/home/admin# i2cget -f -y 18 0x60 0x25
0x06
root@sonic:/home/admin# pddf_ledutil getstatusled LOC_LED
amber
root@sonic:/home/admin#

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106

Description for the changelog

A picture of a cute animal (not mandatory but encouraged)

@lgtm-com
Copy link

lgtm-com bot commented Dec 17, 2021

This pull request introduces 2 alerts when merging 117a733 into 36673c1 - view on LGTM.com

new alerts:

  • 2 for Unused local variable

Copy link
Contributor

@jostar-yang jostar-yang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes are ok to me.

@lguohan
Copy link
Collaborator

lguohan commented Jan 3, 2022

can you fix lgtm warnings?

Copy link
Collaborator

@lguohan lguohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@FuzailBrcm
Copy link
Contributor Author

Already fixed LGTM warnings

@lguohan lguohan merged commit fa361f1 into sonic-net:master Jan 3, 2022
seanwu-ec pushed a commit to seanwu-ec/sonic-buildimage that referenced this pull request Jan 13, 2022
sonic-net#9585)

- Why I did it
PDDF utils were python2 compliant and they needed to be migrated to Python3 (as per Bullseye)
PDDF common platform APIs file name changed as the name was already in use
Indentation issues
Dead/redundant code needed to be removed

- How I did it
Made files Python3 compliant
Indentation corrected
Redundant code removed

- How to verify it
AS7326 Accton platform uses PDDF. PDDF utils were run on this platform to verify.
@xumia
Copy link
Collaborator

xumia commented Mar 25, 2022

@FuzailBrcm , @lguohan , the PR should be merged to 202111 branch , right?

https://dev.azure.com/mssonic/build/_build/results?buildId=83767&view=artifacts&pathAsName=false&type=publishedArtifacts

2022-03-24T08:43:42.4647297Z [ finished ] [ target/files/bullseye/ctrmgrd.service ] 
2022-03-24T08:43:53.5709336Z fatal: Unable to hash device/arista/x86_64-arista_7050_qx32/plugins
2022-03-24T08:43:53.6951544Z fatal: Unable to hash device/mellanox/x86_64-mlnx_lssn2700-r0/LS-SN2700
2022-03-24T08:43:53.7692627Z fatal: Unable to hash device/virtual/x86_64-kvm_x86_64_6_asic-r0/plugins
2022-03-24T08:43:55.0486029Z fatal: Unable to hash platform/broadcom/sonic-platform-modules-nokia
2022-03-24T08:43:55.1509192Z fatal: Unable to hash src/linkmgrd
2022-03-24T08:43:55.1576244Z make: *** [Makefile.cache:575: target/python-wheels/bullseye/sonic_platform_pddf_common-1.0-py3-none-any.whl.dep] Error 123

The value is not defined.
https://github.com/Azure/sonic-buildimage/blob/e10504592af6644775a628c6db3afe6fb375701d/platform/pddf/platform-api-pddf-base.dep#L2

Need to merge the change from master to 202111 branch:
https://github.com/Azure/sonic-buildimage/blob/928261845058a177c4b65ebaf20495e85d48a497/platform/pddf/platform-api-pddf-base.dep#L2

@FuzailBrcm
Copy link
Contributor Author

The error you pointed out is due to $(ENABLE_PY2_MODULES) not equal to 'y'. I guess bullseye is enabled in 202211 branch. Then, yes this PR is required in 202211 branch.

@xumia xumia added the Request for 202111 Branch For PRs being requested for 202111 branch label Mar 25, 2022
xumia pushed a commit that referenced this pull request Mar 25, 2022
#9585)

- Why I did it
PDDF utils were python2 compliant and they needed to be migrated to Python3 (as per Bullseye)
PDDF common platform APIs file name changed as the name was already in use
Indentation issues
Dead/redundant code needed to be removed

- How I did it
Made files Python3 compliant
Indentation corrected
Redundant code removed

- How to verify it
AS7326 Accton platform uses PDDF. PDDF utils were run on this platform to verify.
@xumia xumia added Included in 202111 Branch and removed Request for 202111 Branch For PRs being requested for 202111 branch labels Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants