Skip to content

Commit 93641f3

Browse files
authored
Unifying the platform api for get_pcie_aer_stats with PcieBase (sonic-net#197)
Unifying the platform api for get_pcie_aer_stats with PcieBase
1 parent 7670b49 commit 93641f3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sonic_platform_base/sonic_pcie/pcie_common.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def load_config_file(self):
2727
config_file = "{}/pcie{}.yaml".format(self.config_path, conf_rev)
2828
try:
2929
with open(config_file) as conf_file:
30-
self.confInfo = yaml.load(conf_file)
30+
self.confInfo = yaml.safe_load(conf_file)
3131
except IOError as e:
3232
print("Error: {}".format(str(e)))
3333
print("Not found config file, please add a config file manually, or generate it by running [pcieutil pcie_generate]")
@@ -101,9 +101,9 @@ def get_pcie_check(self):
101101
return self.confInfo
102102

103103
# return AER stats of PCIe device
104-
def get_pcie_aer_stats(self, domain=0, bus=0, device=0, func=0):
104+
def get_pcie_aer_stats(self, domain=0, bus=0, dev=0, func=0):
105105
aer_stats = {'correctable': {}, 'fatal': {}, 'non_fatal': {}}
106-
dev_path = os.path.join('/sys/bus/pci/devices', '%04x:%02x:%02x.%d' % (domain, bus, device, func))
106+
dev_path = os.path.join('/sys/bus/pci/devices', '%04x:%02x:%02x.%d' % (domain, bus, dev, func))
107107

108108
# construct AER sysfs filepath
109109
correctable_path = os.path.join(dev_path, "aer_dev_correctable")

0 commit comments

Comments
 (0)