Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions sfputil/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@

# Global platform-specific sfputil class instance
platform_sfputil = None

PLATFORM_JSON = 'platform.json'
PORT_CONFIG_INI = 'port_config.ini'

# ========================== Syslog wrappers ==========================

Expand Down Expand Up @@ -329,14 +330,13 @@ def get_path_to_port_config_file():
hwsku_path = "/".join([platform_path, hwsku])

# First check for the presence of the new 'port_config.ini' file
port_config_file_path = "/".join([hwsku_path, "port_config.ini"])
port_config_file_path = "/".join([platform_path, PLATFORM_JSON])
if not os.path.isfile(port_config_file_path):
# port_config.ini doesn't exist. Try loading the legacy 'portmap.ini' file
port_config_file_path = "/".join([hwsku_path, "portmap.ini"])
# platform.json doesn't exist. Try loading the legacy 'port_config.ini' file
port_config_file_path = "/".join([hwsku_path, PORT_CONFIG_INI])

return port_config_file_path


# Loads platform specific sfputil module from source
def load_platform_sfputil():
global platform_sfputil
Expand Down