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

celestica: reallocate the empty LIST at the constructor of subclasses #3738

Merged
merged 1 commit into from
Nov 12, 2019
Merged

Conversation

ds952811
Copy link
Contributor

@ds952811 ds952811 commented Nov 12, 2019

While this is part of the following PR, it will do no harm even if the
PR is rejected

sonic-net/sonic-platform-common#65

Signed-off-by: Dante Su dante.su@broadcom.com

- What I did
Calling superclass.__init__() at the beginning the constructor

- How I did it
Move the superclass.__init__() to the beginning of the constructor

- How to verify it
It does not make any difference if PR#65 to sonic-platform-common is not in place,
and it could be verified with the following scripts when the PR#65 is merged

# source /host/machine.conf
# export PYTHONPATH=/usr/share/sonic/device/$onie_platform
# vi test.py
--------------------------------------------------------------------------------------
#!/usr/bin/env python

import sonic_platform.platform

chassis = sonic_platform.platform.Platform().get_chassis()
if chassis is None:
    print("Error getting chassis!")
    sys.exit(1)

print("FAN number: {}".format(chassis.get_num_fans()))

chassis = sonic_platform.platform.Platform().get_chassis()
if chassis is None:
    print("Error getting chassis!")
    sys.exit(1)

print("FAN number: {}".format(chassis.get_num_fans()))
--------------------------------------------------------------------------------------

# chmod +x test.py
# ./test.py

- Description for the changelog

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

While this is part of the following PR, it will do no harm even if the
PR is rejected

sonic-net/sonic-platform-common#65

Signed-off-by: Dante Su <dante.su@broadcom.com>
@jleveque jleveque merged commit 473fc6d into sonic-net:master Nov 12, 2019
zhenggen-xu pushed a commit to zhenggen-xu/sonic-buildimage that referenced this pull request Jan 10, 2020
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.

2 participants