From e540c31f9bfd26bca68bd0b52a72c761650a6135 Mon Sep 17 00:00:00 2001 From: Sangita Maity Date: Tue, 28 Jan 2020 10:30:04 -0800 Subject: [PATCH] Fix sonic-cfggen --hwsku|-k command (#33) Signed-off-by: Sangita Maity --- src/sonic-config-engine/sonic-cfggen | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sonic-config-engine/sonic-cfggen b/src/sonic-config-engine/sonic-cfggen index a4b7792bad72..e96f887fde37 100755 --- a/src/sonic-config-engine/sonic-cfggen +++ b/src/sonic-config-engine/sonic-cfggen @@ -37,7 +37,7 @@ from functools import partial from minigraph import minigraph_encoder from minigraph import parse_xml from minigraph import parse_device_desc_xml -from portconfig import get_port_config, get_breakout_mode +from portconfig import get_port_config, get_port_config_file_name, get_breakout_mode from sonic_device_util import get_machine_info from sonic_device_util import get_platform_info from sonic_device_util import get_system_mac @@ -227,6 +227,8 @@ def main(): 'hwsku': hwsku }}} deep_update(data, hardware_data) + if args.port_config is None: + args.port_config = get_port_config_file_name(hwsku, platform) (ports, _) = get_port_config(hwsku, platform, args.port_config) if not ports: print('Failed to get port config', file=sys.stderr)