forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #221 from ningmengcao060634/201911_cel_dev
1.add bmc-console log filter 2.delete import sonic fwmgr module 3 mod…
- Loading branch information
Showing
7 changed files
with
183 additions
and
17 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
device/alibaba/x86_64-alibaba_as14-128h-cl-r0/get_fw_version.py
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,53 @@ | ||
#!/usr/bin/python | ||
try: | ||
import imp | ||
import os | ||
except ImportError, e: | ||
raise ImportError (str(e) + " - required module not find!") | ||
|
||
FWMGR_PY_PATH = "/usr/share/sonic/device/x86_64-alibaba_as14-40d-cl-r0/plugins/fwmgrutil.py" | ||
FWMGR_MODULE_NAME = "fwmgrutil" | ||
FWMGR_CLASS_NAME = "FwMgrUtil" | ||
|
||
def get_all_versions(): | ||
try: | ||
module = imp.load_source(FWMGR_MODULE_NAME, FWMGR_PY_PATH) | ||
except IOError as e: | ||
print("load module %s failed, ERR: %s" % (FWMGR_MODULE_NAME, str(e))) | ||
return -1 | ||
|
||
try: | ||
fwmgrutil_class = getattr(module, FWMGR_CLASS_NAME) | ||
fwmgrutil = fwmgrutil_class() | ||
except AttributeError as e: | ||
print("instantiate class %s failed, ERR: %s " % (FWMGR_CLASS_NAME, str(e))) | ||
return -2 | ||
|
||
version_str = "" | ||
version_str = fwmgrutil.get_bmc_version() | ||
print("bmc_version: %s " % (version_str) ) | ||
|
||
version_str = "" | ||
version_str = fwmgrutil.get_cpld_version() | ||
print("cpld_version: %s " % (version_str) ) | ||
|
||
version_str = "" | ||
version_str = fwmgrutil.get_bios_version() | ||
print("bios_version: %s " % (version_str) ) | ||
|
||
version_str = "" | ||
version_str = fwmgrutil.get_onie_version() | ||
print("onie_version: %s " % (version_str) ) | ||
|
||
version_str = "" | ||
version_str = fwmgrutil.get_pcie_version() | ||
print("pcie_version: %s " % (version_str) ) | ||
|
||
version_str = "" | ||
version_str = fwmgrutil.get_fpga_version() | ||
print("fpga_version: %s " % (version_str) ) | ||
|
||
return 0 | ||
|
||
if __name__ == '__main__': | ||
get_all_versions() |
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
53 changes: 53 additions & 0 deletions
53
device/alibaba/x86_64-alibaba_as14-40d-cl-r0/get_fw_version.py
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,53 @@ | ||
#!/usr/bin/python | ||
try: | ||
import imp | ||
import os | ||
except ImportError, e: | ||
raise ImportError (str(e) + " - required module not find!") | ||
|
||
FWMGR_PY_PATH = "/usr/share/sonic/device/x86_64-alibaba_as14-40d-cl-r0/plugins/fwmgrutil.py" | ||
FWMGR_MODULE_NAME = "fwmgrutil" | ||
FWMGR_CLASS_NAME = "FwMgrUtil" | ||
|
||
def get_all_versions(): | ||
try: | ||
module = imp.load_source(FWMGR_MODULE_NAME, FWMGR_PY_PATH) | ||
except IOError as e: | ||
print("load module %s failed, ERR: %s" % (FWMGR_MODULE_NAME, str(e))) | ||
return -1 | ||
|
||
try: | ||
fwmgrutil_class = getattr(module, FWMGR_CLASS_NAME) | ||
fwmgrutil = fwmgrutil_class() | ||
except AttributeError as e: | ||
print("instantiate class %s failed, ERR: %s " % (FWMGR_CLASS_NAME, str(e))) | ||
return -2 | ||
|
||
version_str = "" | ||
version_str = fwmgrutil.get_bmc_version() | ||
print("bmc_version: %s " % (version_str) ) | ||
|
||
version_str = "" | ||
version_str = fwmgrutil.get_cpld_version() | ||
print("cpld_version: %s " % (version_str) ) | ||
|
||
version_str = "" | ||
version_str = fwmgrutil.get_bios_version() | ||
print("bios_version: %s " % (version_str) ) | ||
|
||
version_str = "" | ||
version_str = fwmgrutil.get_onie_version() | ||
print("onie_version: %s " % (version_str) ) | ||
|
||
version_str = "" | ||
version_str = fwmgrutil.get_pcie_version() | ||
print("pcie_version: %s " % (version_str) ) | ||
|
||
version_str = "" | ||
version_str = fwmgrutil.get_fpga_version() | ||
print("fpga_version: %s " % (version_str) ) | ||
|
||
return 0 | ||
|
||
if __name__ == '__main__': | ||
get_all_versions() |
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
53 changes: 53 additions & 0 deletions
53
device/alibaba/x86_64-alibaba_as24-128d-cl-r0/get_fw_version.py
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,53 @@ | ||
#!/usr/bin/python | ||
try: | ||
import imp | ||
import os | ||
except ImportError, e: | ||
raise ImportError (str(e) + " - required module not find!") | ||
|
||
FWMGR_PY_PATH = "/usr/share/sonic/device/x86_64-alibaba_as14-40d-cl-r0/plugins/fwmgrutil.py" | ||
FWMGR_MODULE_NAME = "fwmgrutil" | ||
FWMGR_CLASS_NAME = "FwMgrUtil" | ||
|
||
def get_all_versions(): | ||
try: | ||
module = imp.load_source(FWMGR_MODULE_NAME, FWMGR_PY_PATH) | ||
except IOError as e: | ||
print("load module %s failed, ERR: %s" % (FWMGR_MODULE_NAME, str(e))) | ||
return -1 | ||
|
||
try: | ||
fwmgrutil_class = getattr(module, FWMGR_CLASS_NAME) | ||
fwmgrutil = fwmgrutil_class() | ||
except AttributeError as e: | ||
print("instantiate class %s failed, ERR: %s " % (FWMGR_CLASS_NAME, str(e))) | ||
return -2 | ||
|
||
version_str = "" | ||
version_str = fwmgrutil.get_bmc_version() | ||
print("bmc_version: %s " % (version_str) ) | ||
|
||
version_str = "" | ||
version_str = fwmgrutil.get_cpld_version() | ||
print("cpld_version: %s " % (version_str) ) | ||
|
||
version_str = "" | ||
version_str = fwmgrutil.get_bios_version() | ||
print("bios_version: %s " % (version_str) ) | ||
|
||
version_str = "" | ||
version_str = fwmgrutil.get_onie_version() | ||
print("onie_version: %s " % (version_str) ) | ||
|
||
version_str = "" | ||
version_str = fwmgrutil.get_pcie_version() | ||
print("pcie_version: %s " % (version_str) ) | ||
|
||
version_str = "" | ||
version_str = fwmgrutil.get_fpga_version() | ||
print("fpga_version: %s " % (version_str) ) | ||
|
||
return 0 | ||
|
||
if __name__ == '__main__': | ||
get_all_versions() |
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
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