Skip to content

Commit

Permalink
[sfputil] Adapt new way of getting PLATFORM(sonic-net#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
taoyl-ms authored Mar 1, 2018
1 parent 252e9fa commit fce7089
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sfputil/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
PLATFORM_ROOT_PATH = '/usr/share/sonic/device'
SONIC_CFGGEN_PATH = '/usr/local/bin/sonic-cfggen'
MINIGRAPH_PATH = '/etc/sonic/minigraph.xml'
HWSKU_KEY = "DEVICE_METADATA['localhost']['hwsku']"
PLATFORM_KEY = 'platform'
HWSKU_KEY = 'DEVICE_METADATA.localhost.hwsku'
PLATFORM_KEY = 'DEVICE_METADATA.localhost.platform'

# Global platform-specific sfputil class instance
platform_sfputil = None
Expand Down Expand Up @@ -288,7 +288,7 @@ def port_eeprom_data_raw_string_pretty(logical_port_name):
# Returns platform and HW SKU
def get_platform_and_hwsku():
try:
proc = subprocess.Popen([SONIC_CFGGEN_PATH, '-v', PLATFORM_KEY],
proc = subprocess.Popen([SONIC_CFGGEN_PATH, '-H', '-v', PLATFORM_KEY],
stdout=subprocess.PIPE,
shell=False,
stderr=subprocess.STDOUT)
Expand Down

0 comments on commit fce7089

Please sign in to comment.