Fix bug: check port alias even when port_config_file parameter is not provided (#4787)

This commit is contained in:
Qi Luo 2020-06-17 12:12:07 -07:00 committed by GitHub
parent 6014773ac9
commit edf3160224
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -966,10 +966,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None):
for port_name, port in ports.items(): for port_name, port in ports.items():
# get port alias from port_config.ini # get port alias from port_config.ini
if port_config_file: alias = port.get('alias', port_name)
alias = port.get('alias')
else:
alias = port_name
# generate default 100G FEC # generate default 100G FEC
# Note: FECDisabled only be effective on 100G port right now # Note: FECDisabled only be effective on 100G port right now
if port.get('speed') == '100000' and linkmetas.get(alias, {}).get('FECDisabled', '').lower() != 'true': if port.get('speed') == '100000' and linkmetas.get(alias, {}).get('FECDisabled', '').lower() != 'true':