Skip to content

Commit e540c31

Browse files
samaityzhenggen-xu
authored andcommitted
Fix sonic-cfggen --hwsku|-k command (sonic-net#33)
Signed-off-by: Sangita Maity <[email protected]>
1 parent a8c2aee commit e540c31

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/sonic-config-engine/sonic-cfggen

+3-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ from functools import partial
3737
from minigraph import minigraph_encoder
3838
from minigraph import parse_xml
3939
from minigraph import parse_device_desc_xml
40-
from portconfig import get_port_config, get_breakout_mode
40+
from portconfig import get_port_config, get_port_config_file_name, get_breakout_mode
4141
from sonic_device_util import get_machine_info
4242
from sonic_device_util import get_platform_info
4343
from sonic_device_util import get_system_mac
@@ -227,6 +227,8 @@ def main():
227227
'hwsku': hwsku
228228
}}}
229229
deep_update(data, hardware_data)
230+
if args.port_config is None:
231+
args.port_config = get_port_config_file_name(hwsku, platform)
230232
(ports, _) = get_port_config(hwsku, platform, args.port_config)
231233
if not ports:
232234
print('Failed to get port config', file=sys.stderr)

0 commit comments

Comments
 (0)