Skip to content

Commit

Permalink
change hwsku retriever
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Apr 26, 2023
1 parent 5031d8b commit 0f90ed2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion generic_config_updater/field_operation_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ def get_asic_name():
asic = "td3"

if asic == "unknown":
GET_HWSKU_CMD = "sonic-cfggen -d -v DEVICE_METADATA.localhost.hwsku"
spc1_hwskus = [ 'ACS-MSN2700', 'ACS-MSN2740', 'ACS-MSN2100', 'ACS-MSN2410', 'ACS-MSN2010', 'Mellanox-SN2700', 'Mellanox-SN2700-D48C8' ]
if hwsku.lower() in [spc1_hwsku.lower() for spc1_hwsku in spc1_hwskus]:
p = subprocess.Popen(GET_HWSKU_CMD, shell=True, universal_newlines=True, stdout=subprocess.PIPE)
out, err = p.communicate()
sku_name = out.rstrip('\n')
if sku_name.lower() in [spc1_hwsku.lower() for spc1_hwsku in spc1_hwskus]:
asic = "spc1"

return asic
Expand Down

0 comments on commit 0f90ed2

Please sign in to comment.