Skip to content

Commit

Permalink
[xcvrd] get hwsku from DB instead of from minigraph, avoid to access …
Browse files Browse the repository at this point in the history
…none presenct SFP eeprom (#19)
  • Loading branch information
keboliu authored and jleveque committed Oct 22, 2018
1 parent b1b9169 commit bc23ab0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions sonic-xcvrd/scripts/xcvrd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ SYSLOG_IDENTIFIER = os.path.basename(__file__)

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 = 'DEVICE_METADATA.localhost.platform'

Expand Down Expand Up @@ -117,7 +116,7 @@ def get_platform_and_hwsku():
proc.wait()
platform = stdout.rstrip('\n')

proc = subprocess.Popen([SONIC_CFGGEN_PATH, '-m', MINIGRAPH_PATH, '-v', HWSKU_KEY],
proc = subprocess.Popen([SONIC_CFGGEN_PATH, '-d', '-v', HWSKU_KEY],
stdout=subprocess.PIPE,
shell=False,
stderr=subprocess.STDOUT)
Expand Down Expand Up @@ -233,6 +232,9 @@ def post_port_sfp_info_to_db(logical_port_name, table):
ganged_port = True

for physical_port in physical_port_list:
if not platform_sfputil.get_presence(physical_port):
continue

port_name = get_physical_port_name(logical_port_name, ganged_member_num, ganged_port)
ganged_member_num += 1

Expand Down Expand Up @@ -266,6 +268,9 @@ def post_port_dom_info_to_db(logical_port_name, table):
ganged_port = True

for physical_port in physical_port_list:
if not platform_sfputil.get_presence(physical_port):
continue

port_name = get_physical_port_name(logical_port_name, ganged_member_num, ganged_port)
ganged_member_num += 1

Expand Down

0 comments on commit bc23ab0

Please sign in to comment.