Skip to content

Commit

Permalink
Merge pull request #221 from ningmengcao060634/201911_cel_dev
Browse files Browse the repository at this point in the history
1.add bmc-console log filter 2.delete import sonic fwmgr module 3 mod…
  • Loading branch information
celestica-gl authored Oct 23, 2020
2 parents 1bc23c2 + 3c9a5af commit ea1a9f7
Show file tree
Hide file tree
Showing 7 changed files with 183 additions and 17 deletions.
53 changes: 53 additions & 0 deletions device/alibaba/x86_64-alibaba_as14-128h-cl-r0/get_fw_version.py
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()
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
import ast
from datetime import datetime

try:
from sonic_fwmgr.fwgmr_base import FwMgrUtilBase
except ImportError as e:
raise ImportError("%s - required module not found" % str(e))
#try:
# from sonic_fwmgr.fwgmr_base import FwMgrUtilBase
#except ImportError as e:
# raise ImportError("%s - required module not found" % str(e))


class FwMgrUtil(FwMgrUtilBase):
class FwMgrUtil():
BMC_REQ_BASE_URI = "http://240.1.1.1:8080/api"
ONIE_CFG_FILE = "/host/machine.conf"

def __init__(self):
self.platform_name = "AS1348f8h"
self.platform_name = "AS14128H"
self.bmc_info_uri = "/".join([self.BMC_REQ_BASE_URI, "bmc/info"])
self.bmc_nextboot_uri = "/".join([self.BMC_REQ_BASE_URI, "bmc/nextboot"])
self.bmc_reboot_uri = "/".join([self.BMC_REQ_BASE_URI, "bmc/reboot"])
Expand Down
53 changes: 53 additions & 0 deletions device/alibaba/x86_64-alibaba_as14-40d-cl-r0/get_fw_version.py
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()
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
import ast
from datetime import datetime

try:
from sonic_fwmgr.fwgmr_base import FwMgrUtilBase
except ImportError as e:
raise ImportError("%s - required module not found" % str(e))
#try:
# from sonic_fwmgr.fwgmr_base import FwMgrUtilBase
#except ImportError as e:
# raise ImportError("%s - required module not found" % str(e))


class FwMgrUtil(FwMgrUtilBase):
class FwMgrUtil():
BMC_REQ_BASE_URI = "http://240.1.1.1:8080/api"
ONIE_CFG_FILE = "/host/machine.conf"

def __init__(self):
self.platform_name = "AS1348f8h"
self.platform_name = "AS1440D"
self.bmc_info_uri = "/".join([self.BMC_REQ_BASE_URI, "bmc/info"])
self.bmc_nextboot_uri = "/".join([self.BMC_REQ_BASE_URI, "bmc/nextboot"])
self.bmc_reboot_uri = "/".join([self.BMC_REQ_BASE_URI, "bmc/reboot"])
Expand Down
53 changes: 53 additions & 0 deletions device/alibaba/x86_64-alibaba_as24-128d-cl-r0/get_fw_version.py
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()
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
import ast
from datetime import datetime

try:
from sonic_fwmgr.fwgmr_base import FwMgrUtilBase
except ImportError as e:
raise ImportError("%s - required module not found" % str(e))
#try:
# from sonic_fwmgr.fwgmr_base import FwMgrUtilBase
#except ImportError as e:
# raise ImportError("%s - required module not found" % str(e))


class FwMgrUtil(FwMgrUtilBase):
class FwMgrUtil():
BMC_REQ_BASE_URI = "http://240.1.1.1:8080/api"
ONIE_CFG_FILE = "/host/machine.conf"

Expand Down
7 changes: 7 additions & 0 deletions files/image_config/rsyslog/rsyslog.d/00-sonic.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,10 @@ if $msg startswith " telemetry" or ($msg startswith " dialout" )then {
/var/log/telemetry.log
stop
}

## bmc_console log
if $syslogtag contains "bmc#console" then {
/var/log/bmc-console.log
stop
}

0 comments on commit ea1a9f7

Please sign in to comment.