sonic-buildimage/device/arista/x86_64-arista_7060_cx32s/plugins/sfputil.py
Samuel Angebault cb969fc843 [platform] Add Arista DCS-7050QX-32S and missing plugins (#597)
* Update sonic-platform-modules-arista submodule

* Add sensors.conf for Arista DCS-7050QX-32S

* Add plugin/eeprom.py for Arista DCS-7050QX-32S

* Add plugin/sfputil.py for Arista DCS-7050QX-32S

* Add port_config.ini for Arista DCS-7050QX-32S

* Add plugin/sfputil.py for Arista DCS-7060CX-32S

* Add plugin/eeprom.py for Arista DCS-7060CX-32S

* Update plugin/eeprom.py for Arista DCS-7050QX-32
2017-05-16 08:07:47 -07:00

29 lines
778 B
Python

#!/usr/bin/env python
try:
from sonic_sfp.sfputilbase import sfputilbase
except ImportError, e:
raise ImportError (str(e) + "- required module not found")
class sfputil(sfputilbase):
"""Platform specific sfputil class"""
port_start = 0
port_end = 33
ports_in_block = 34
eeprom_offset = 18
port_to_eeprom_mapping = {}
_qsfp_ports = range(0, 32 + 1)
_sfp_ports = range(33, 34 + 1)
def __init__(self, port_num):
# Override port_to_eeprom_mapping for class initialization
eeprom_path = '/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom'
for x in range(0, self.port_end + 1):
self.port_to_eeprom_mapping[x] = eeprom_path.format(x + self.eeprom_offset)
sfputilbase.__init__(self, port_num)