diff --git a/sonic_platform_base/sonic_pcie/pcie_common.py b/sonic_platform_base/sonic_pcie/pcie_common.py index b212ddaa212f..d448a653367c 100644 --- a/sonic_platform_base/sonic_pcie/pcie_common.py +++ b/sonic_platform_base/sonic_pcie/pcie_common.py @@ -19,10 +19,12 @@ class PcieUtil(PcieBase): # got the config file path def __init__(self, path): self.config_path = path + self._conf_rev = None # load the config file def load_config_file(self): - config_file = self.config_path + "/" + "pcie.yaml" + conf_rev = "_{}".format(self._conf_rev) if self._conf_rev else "" + config_file = "{}/pcie{}.yaml".format(self.config_path, conf_rev) try: with open(config_file) as conf_file: self.confInfo = yaml.load(conf_file) @@ -137,6 +139,8 @@ def get_pcie_aer_stats(self, domain=0, bus=0, device=0, func=0): # generate the config file with current pci device def dump_conf_yaml(self): curInfo = self.get_pcie_device() - with open(self.config_path + "/" + "pcie.yaml", "w") as conf_file: + conf_rev = "_{}".format(self._conf_rev) if self._conf_rev else "" + config_file = "{}/pcie{}.yaml".format(self.config_path, conf_rev) + with open(config_file, "w") as conf_file: yaml.dump(curInfo, conf_file, default_flow_style=False) return