Skip to content

Commit

Permalink
fixed sai xml name format
Browse files Browse the repository at this point in the history
  • Loading branch information
skr31 committed Aug 19, 2024
1 parent 7e063f7 commit aed88d1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions platform/mellanox/cmis_host_mgmt/cmis_host_mgmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import re
import os
import subprocess
import glob


class CMISHostMgmtActivator:
Expand Down Expand Up @@ -137,8 +138,15 @@ def enable(args):

if not CMISHostMgmtActivator.is_spc_supported(sku_num):
print("Error: unsupported platform - feature is supported on SPC3 and higher.")

CMISHostMgmtActivator.PARAMS["sai_xml"]["file_name"] = "sai_{0}.xml".format(sku_num)

# Find sai_*.xml, assume there can only be one in the directory
sai_xml_list = glob.glob(os.path.join(sku_path + "/sai*.xml"))
sai_xml_name = sai_xml_list[0]
if sai_xml_name:
sai_xml_name = sai_xml_name.split('/')[-1]
CMISHostMgmtActivator.PARAMS["sai_xml"]["file_name"] = sai_xml_name
else:
print("Error: no sai_*.xml file present")

CMISHostMgmtActivator.copy_file(args[0], sku_path)
CMISHostMgmtActivator.copy_file(args[1], sku_path)
Expand Down

0 comments on commit aed88d1

Please sign in to comment.