forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sonic_psu module along with initial psu_base.py base class for pl…
…ugins (sonic-net#116)
- Loading branch information
Showing
3 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env python | ||
# | ||
# psu_base.py | ||
# | ||
# Abstract base class for implementing platform-specific | ||
# PSU control functionality for SONiC | ||
# | ||
|
||
try: | ||
import abc | ||
except ImportError, e: | ||
raise ImportError (str(e) + " - required module not found") | ||
|
||
class PsuBase(object): | ||
__metaclass__ = abc.ABCMeta | ||
|
||
@abc.abstractmethod | ||
def get_psu_status(self, index): | ||
""" | ||
Retrieves the oprational status of power supply unit (PSU) defined | ||
by index <index> | ||
:param index: An integer, index of the PSU of which to query status | ||
:return: Boolean, True if PSU is operating properly, False if PSU is faulty | ||
""" | ||
return False |