Skip to content

Commit 06983e4

Browse files
committed
Addressing review comments
Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <[email protected]>
1 parent cd3a678 commit 06983e4

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/sonic-config-engine/sonic-cfggen

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def main():
229229
asic_id = None
230230
if asic_name is not None:
231231
asic_id = get_npu_id_from_name(asic_name)
232-
asic_role = parse_asic_sub_role(args.minigraph if args.minigraph else '/etc/sonic/minigraph.xml', asic_name)
232+
233233

234234
if hwsku is not None:
235235
hardware_data = {'DEVICE_METADATA': {'localhost': {
@@ -276,8 +276,18 @@ def main():
276276
deep_update(data, FormatConverter.db_to_output(configdb.get_config()))
277277

278278

279+
# for multi Asic platforms to generate the platform info for an Asic
280+
# the minigraph file must be provided
279281
if args.platform_info:
280-
if asic_name is not None and asic_role.lower() == "backend":
282+
asic_role = None
283+
mac = None
284+
if asic_name is not None:
285+
if args.minigraph is None:
286+
print('Failed to get minigraph')
287+
sys.exit(1)
288+
asic_role = parse_asic_sub_role(args.minigraph, asic_name)
289+
290+
if asic_role is not None and asic_role.lower() == "backend":
281291
mac = get_system_mac(namespace=asic_name)
282292
else:
283293
mac = get_system_mac()

0 commit comments

Comments
 (0)