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 pice_base.py #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions sonic_platform_base/pcie_base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env python
#
# pcie_base.py
#
# Abstract base class for implementing platform-specific
# PCIE functionality for SONiC
#

try:
import abc
except ImportError as e:
raise ImportError (str(e) + " - required module not found")

class PcieBase(object):
__metaclass__ = abc.ABCMeta

@abc.abstractmethod
Copy link
Collaborator

Choose a reason for hiding this comment

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

why need "@abc.abstractmethod"?

def get_pcie_speed(self,device):
"""
Retrieves PCIE speed for the given device

Returns:
A string holding PCIE speed with specific device
"""

raise NotImplementedError



def get_pcie_id(self,device):

"""
Retrieves PCIE id for the given device

Returns:
A string holding PCIE id with specific device
"""
raise NotImplementedError