diff --git a/device/barefoot/x86_64-accton_as9516_32d-r0/plugins b/device/barefoot/x86_64-accton_as9516_32d-r0/plugins deleted file mode 120000 index a8464d1ec2..0000000000 --- a/device/barefoot/x86_64-accton_as9516_32d-r0/plugins +++ /dev/null @@ -1 +0,0 @@ -../x86_64-accton_wedge100bf_32x-r0/plugins/ \ No newline at end of file diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/eeprom.py b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/eeprom.py deleted file mode 100644 index b94fab471b..0000000000 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/eeprom.py +++ /dev/null @@ -1,184 +0,0 @@ -try: - import importlib - import time - import os - import re - import sys - import errno - import datetime - import logging - import logging.config - import yaml - - sys.path.append(os.path.dirname(__file__)) - import pltfm_mgr_rpc - from pltfm_mgr_rpc.ttypes import * - - from thrift.transport import TSocket - from thrift.transport import TTransport - from thrift.protocol import TBinaryProtocol - from thrift.protocol import TMultiplexedProtocol - - from argparse import ArgumentParser - - if sys.version_info.major == 3: - from io import StringIO - else: - from cStringIO import StringIO - - from sonic_eeprom import eeprom_base - from sonic_eeprom import eeprom_tlvinfo -except ImportError as e: - raise ImportError(str(e) + "- required module not found") - - -if sys.version_info.major == 3: - STRING_TYPE = str -else: - STRING_TYPE = basestring - - -eeprom_default_dict = { - "prod_name": ("Product Name", "0x21", 12), - "odm_pcba_part_num": ("Part Number", "0x22", 13), - "prod_ser_num": ("Serial Number", "0x23", 12), - "ext_mac_addr": ("Extended MAC Address Base", "0x24", 12), - "sys_mfg_date": ("System Manufacturing Date", "0x25", 4), - "prod_ver": ("Product Version", "0x26", 1), - "ext_mac_addr_size": ("Extende MAC Address Size", "0x2A", 2), - "sys_mfger": ("Manufacturer", "0x2B", 8) -} - -eeprom_dict = {"version": ("Version", None, 0), - "pcb_mfger": ("PCB Manufacturer", "0x01", 8), - "prod_ser_num": ("Serial Number", "0x23", 12), - "bfn_pcba_part_num": ("Switch PCBA Part Number", "0x02", 12), - "odm_pcba_part_num": ("Part Number", "0x22", 13), - "bfn_pcbb_part_num": ("Switch PCBB Part Number", "0x04", 12), - "sys_asm_part_num": ("System Assembly Part Number", "0x05", 12), - "prod_state": ("Product Production State", "0x06", 1), - "location": ("EEPROM Location of Fabric", "0x07", 8), - "ext_mac_addr_size": ("Extende MAC Address Size", "0x08", 2), - "sys_mfg_date": ("System Manufacturing Date", "0x25", 4), - "prod_name": ("Product Name", "0x21", 12), - "prod_ver": ("Product Version", "0x26", 1), - "prod_part_num": ("Product Part Number", "0x09", 8), - "sys_mfger": ("Manufacturer", "0x2B", 8), - "assembled_at": ("Assembled at", "0x08", 8), - "prod_ast_tag": ("Product Asset Tag", "0x09", 12), - "loc_mac_addr": ("Local MAC address", "0x0A", 12), - "odm_pcba_ser_num": ("ODM PBCA Serial Number", "0x0B", 12), - "ext_mac_addr": ("Extended MAC Address Base", "0x0C", 12), - "prod_sub_ver": ("Product Sub Version", "0x0D", 1) - } - -product_dict = {"Montara": "Wedge100BF-32X-O-AC-F-BF", - "Lower MAV": "Wedge100BF-65X-O-AC-F-BF", - "Upper MAV": "Wedge100BF-65X-O-AC-F-BF" - } - -thrift_server = 'localhost' -transport = None -pltfm_mgr = None - -EEPROM_SYMLINK = "/var/run/platform/eeprom/syseeprom" -EEPROM_STATUS = "/var/run/platform/eeprom/status" - - -class board(eeprom_tlvinfo.TlvInfoDecoder): - RETRIES = 35 - - def __init__(self, name, path, cpld_root, ro): - - with open(os.path.dirname(__file__) + "/logging.conf", 'r') as f: - config_dict = yaml.load(f, yaml.SafeLoader) - logging.config.dictConfig(config_dict) - - if not os.path.exists(os.path.dirname(EEPROM_SYMLINK)): - try: - os.makedirs(os.path.dirname(EEPROM_SYMLINK)) - except OSError as e: - if e.errno != errno.EEXIST: - raise - - open(EEPROM_SYMLINK, 'a').close() - f = open(EEPROM_STATUS, 'w') - f.write("initializing..") - f.close() - - self.eeprom_path = EEPROM_SYMLINK - super(board, self).__init__(self.eeprom_path, 0, EEPROM_STATUS, True) - - for attempt in range(self.RETRIES): - if self.eeprom_init(): - break - if attempt + 1 == self.RETRIES: - raise RuntimeError("eeprom.py: Initialization failed") - time.sleep(1) - - def thrift_setup(self): - global thrift_server, transport, pltfm_mgr - transport = TSocket.TSocket(thrift_server, 9090) - - transport = TTransport.TBufferedTransport(transport) - bprotocol = TBinaryProtocol.TBinaryProtocol(transport) - - pltfm_mgr_client_module = importlib.import_module( - ".".join(["pltfm_mgr_rpc", "pltfm_mgr_rpc"])) - pltfm_mgr_protocol = TMultiplexedProtocol.TMultiplexedProtocol( - bprotocol, "pltfm_mgr_rpc") - pltfm_mgr = pltfm_mgr_client_module.Client(pltfm_mgr_protocol) - - transport.open() - - def thrift_teardown(self): - global transport - transport.close() - - def eeprom_init(self): - global pltfm_mgr - - try: - self.thrift_setup() - eeprom = pltfm_mgr.pltfm_mgr_sys_eeprom_get() - self.thrift_teardown() - except: - return False - - f = open(EEPROM_STATUS, 'w') - f.write("ok") - f.close() - - eeprom_params = "" - for attr, val in eeprom.__dict__.items(): - if val is None: - continue - - elem = eeprom_default_dict.get(attr) - if elem is None: - continue - - if isinstance(val, STRING_TYPE): - value = val.replace('\0', '') - else: - value = str(val) - - if attr == "sys_mfg_date": - value = datetime.datetime.strptime( - value, '%m-%d-%y').strftime('%m/%d/%Y 00:00:00') - - product = product_dict.get(value) - if product is not None: - value = product - if len(eeprom_params) > 0: - eeprom_params += "," - eeprom_params += "{0:s}={1:s}".format(elem[1], value) - - orig_stdout = sys.stdout - sys.stdout = StringIO() - new_e = eeprom_tlvinfo.TlvInfoDecoder.set_eeprom( - self, "", [eeprom_params]) - sys.stdout = orig_stdout - eeprom_base.EepromDecoder.write_eeprom(self, new_e) - - return True diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/logging.conf b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/logging.conf deleted file mode 100644 index d7fd847734..0000000000 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/logging.conf +++ /dev/null @@ -1,17 +0,0 @@ -version: 1 -disable_existing_loggers: False - -formatters: - simple: - format: '%(asctime)s %(name)-30s %(levelname)-7s %(message)s' - -handlers: - file: - class: logging.handlers.RotatingFileHandler - formatter: simple - filename: /var/log/platform.log - -root: - level: ERROR - handlers: - - file diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/pltfm_mgr_rpc/__init__.py b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/pltfm_mgr_rpc/__init__.py deleted file mode 100644 index 414c3d6389..0000000000 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/pltfm_mgr_rpc/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__all__ = ['ttypes', 'pltfm_mgr_rpc'] diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/pltfm_mgr_rpc/pltfm_mgr_rpc.py b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/pltfm_mgr_rpc/pltfm_mgr_rpc.py deleted file mode 100644 index 8f5b89e431..0000000000 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/pltfm_mgr_rpc/pltfm_mgr_rpc.py +++ /dev/null @@ -1,2940 +0,0 @@ -# -# Autogenerated by Thrift Compiler (0.10.0) -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# -# options string: py -# - -from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException -from thrift.protocol.TProtocol import TProtocolException -import sys -import logging -from .ttypes import * -from thrift.Thrift import TProcessor -from thrift.transport import TTransport - - -class Iface(object): - def pltfm_mgr_dummy(self, device): - """ - Parameters: - - device - """ - pass - - def pltfm_mgr_sys_tmp_get(self): - pass - - def pltfm_mgr_sys_eeprom_get(self): - pass - - def pltfm_mgr_pwr_supply_present_get(self, ps_num): - """ - Parameters: - - ps_num - """ - pass - - def pltfm_mgr_pwr_supply_info_get(self, ps_num): - """ - Parameters: - - ps_num - """ - pass - - def pltfm_mgr_pwr_rail_info_get(self, ps_num): - """ - Parameters: - - ps_num - """ - pass - - def pltfm_mgr_fan_speed_set(self, fan_num, percent): - """ - Parameters: - - fan_num - - percent - """ - pass - - def pltfm_mgr_fan_info_get(self, fan_num): - """ - Parameters: - - fan_num - """ - pass - - def pltfm_mgr_qsfp_presence_get(self, port_num): - """ - Parameters: - - port_num - """ - pass - - def pltfm_mgr_qsfp_info_get(self, port_num): - """ - Parameters: - - port_num - """ - pass - - def pltfm_mgr_qsfp_get_max_port(self): - pass - - def pltfm_mgr_qsfp_reset(self, port_num, reset): - """ - Parameters: - - port_num - - reset - """ - pass - - def pltfm_mgr_qsfp_lpmode_get(self, port_num): - """ - Parameters: - - port_num - """ - pass - - def pltfm_mgr_qsfp_lpmode_set(self, port_num, lpmode): - """ - Parameters: - - port_num - - lpmode - """ - pass - - def pltfm_mgr_sensor_info_get(self, options): - """ - Parameters: - - options - """ - pass - - -class Client(Iface): - def __init__(self, iprot, oprot=None): - self._iprot = self._oprot = iprot - if oprot is not None: - self._oprot = oprot - self._seqid = 0 - - def pltfm_mgr_dummy(self, device): - """ - Parameters: - - device - """ - self.send_pltfm_mgr_dummy(device) - return self.recv_pltfm_mgr_dummy() - - def send_pltfm_mgr_dummy(self, device): - self._oprot.writeMessageBegin('pltfm_mgr_dummy', TMessageType.CALL, self._seqid) - args = pltfm_mgr_dummy_args() - args.device = device - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_pltfm_mgr_dummy(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = pltfm_mgr_dummy_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_dummy failed: unknown result") - - def pltfm_mgr_sys_tmp_get(self): - self.send_pltfm_mgr_sys_tmp_get() - return self.recv_pltfm_mgr_sys_tmp_get() - - def send_pltfm_mgr_sys_tmp_get(self): - self._oprot.writeMessageBegin('pltfm_mgr_sys_tmp_get', TMessageType.CALL, self._seqid) - args = pltfm_mgr_sys_tmp_get_args() - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_pltfm_mgr_sys_tmp_get(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = pltfm_mgr_sys_tmp_get_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - if result.ouch is not None: - raise result.ouch - raise TApplicationException(TApplicationException.MISSING_RESULT, - "pltfm_mgr_sys_tmp_get failed: unknown result") - - def pltfm_mgr_sys_eeprom_get(self): - self.send_pltfm_mgr_sys_eeprom_get() - return self.recv_pltfm_mgr_sys_eeprom_get() - - def send_pltfm_mgr_sys_eeprom_get(self): - self._oprot.writeMessageBegin('pltfm_mgr_sys_eeprom_get', TMessageType.CALL, self._seqid) - args = pltfm_mgr_sys_eeprom_get_args() - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_pltfm_mgr_sys_eeprom_get(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = pltfm_mgr_sys_eeprom_get_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - if result.ouch is not None: - raise result.ouch - raise TApplicationException(TApplicationException.MISSING_RESULT, - "pltfm_mgr_sys_eeprom_get failed: unknown result") - - def pltfm_mgr_pwr_supply_present_get(self, ps_num): - """ - Parameters: - - ps_num - """ - self.send_pltfm_mgr_pwr_supply_present_get(ps_num) - return self.recv_pltfm_mgr_pwr_supply_present_get() - - def send_pltfm_mgr_pwr_supply_present_get(self, ps_num): - self._oprot.writeMessageBegin('pltfm_mgr_pwr_supply_present_get', TMessageType.CALL, self._seqid) - args = pltfm_mgr_pwr_supply_present_get_args() - args.ps_num = ps_num - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_pltfm_mgr_pwr_supply_present_get(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = pltfm_mgr_pwr_supply_present_get_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - if result.ouch is not None: - raise result.ouch - raise TApplicationException(TApplicationException.MISSING_RESULT, - "pltfm_mgr_pwr_supply_present_get failed: unknown result") - - def pltfm_mgr_pwr_supply_info_get(self, ps_num): - """ - Parameters: - - ps_num - """ - self.send_pltfm_mgr_pwr_supply_info_get(ps_num) - return self.recv_pltfm_mgr_pwr_supply_info_get() - - def send_pltfm_mgr_pwr_supply_info_get(self, ps_num): - self._oprot.writeMessageBegin('pltfm_mgr_pwr_supply_info_get', TMessageType.CALL, self._seqid) - args = pltfm_mgr_pwr_supply_info_get_args() - args.ps_num = ps_num - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_pltfm_mgr_pwr_supply_info_get(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = pltfm_mgr_pwr_supply_info_get_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - if result.ouch is not None: - raise result.ouch - raise TApplicationException(TApplicationException.MISSING_RESULT, - "pltfm_mgr_pwr_supply_info_get failed: unknown result") - - def pltfm_mgr_pwr_rail_info_get(self, ps_num): - """ - Parameters: - - ps_num - """ - self.send_pltfm_mgr_pwr_rail_info_get(ps_num) - return self.recv_pltfm_mgr_pwr_rail_info_get() - - def send_pltfm_mgr_pwr_rail_info_get(self, ps_num): - self._oprot.writeMessageBegin('pltfm_mgr_pwr_rail_info_get', TMessageType.CALL, self._seqid) - args = pltfm_mgr_pwr_rail_info_get_args() - args.ps_num = ps_num - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_pltfm_mgr_pwr_rail_info_get(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = pltfm_mgr_pwr_rail_info_get_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - if result.ouch is not None: - raise result.ouch - raise TApplicationException(TApplicationException.MISSING_RESULT, - "pltfm_mgr_pwr_rail_info_get failed: unknown result") - - def pltfm_mgr_fan_speed_set(self, fan_num, percent): - """ - Parameters: - - fan_num - - percent - """ - self.send_pltfm_mgr_fan_speed_set(fan_num, percent) - return self.recv_pltfm_mgr_fan_speed_set() - - def send_pltfm_mgr_fan_speed_set(self, fan_num, percent): - self._oprot.writeMessageBegin('pltfm_mgr_fan_speed_set', TMessageType.CALL, self._seqid) - args = pltfm_mgr_fan_speed_set_args() - args.fan_num = fan_num - args.percent = percent - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_pltfm_mgr_fan_speed_set(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = pltfm_mgr_fan_speed_set_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - if result.ouch is not None: - raise result.ouch - raise TApplicationException(TApplicationException.MISSING_RESULT, - "pltfm_mgr_fan_speed_set failed: unknown result") - - def pltfm_mgr_fan_info_get(self, fan_num): - """ - Parameters: - - fan_num - """ - self.send_pltfm_mgr_fan_info_get(fan_num) - return self.recv_pltfm_mgr_fan_info_get() - - def send_pltfm_mgr_fan_info_get(self, fan_num): - self._oprot.writeMessageBegin('pltfm_mgr_fan_info_get', TMessageType.CALL, self._seqid) - args = pltfm_mgr_fan_info_get_args() - args.fan_num = fan_num - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_pltfm_mgr_fan_info_get(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = pltfm_mgr_fan_info_get_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - if result.ouch is not None: - raise result.ouch - raise TApplicationException(TApplicationException.MISSING_RESULT, - "pltfm_mgr_fan_info_get failed: unknown result") - - def pltfm_mgr_qsfp_presence_get(self, port_num): - """ - Parameters: - - port_num - """ - self.send_pltfm_mgr_qsfp_presence_get(port_num) - return self.recv_pltfm_mgr_qsfp_presence_get() - - def send_pltfm_mgr_qsfp_presence_get(self, port_num): - self._oprot.writeMessageBegin('pltfm_mgr_qsfp_presence_get', TMessageType.CALL, self._seqid) - args = pltfm_mgr_qsfp_presence_get_args() - args.port_num = port_num - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_pltfm_mgr_qsfp_presence_get(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = pltfm_mgr_qsfp_presence_get_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - if result.ouch is not None: - raise result.ouch - raise TApplicationException(TApplicationException.MISSING_RESULT, - "pltfm_mgr_qsfp_presence_get failed: unknown result") - - def pltfm_mgr_qsfp_info_get(self, port_num): - """ - Parameters: - - port_num - """ - self.send_pltfm_mgr_qsfp_info_get(port_num) - return self.recv_pltfm_mgr_qsfp_info_get() - - def send_pltfm_mgr_qsfp_info_get(self, port_num): - self._oprot.writeMessageBegin('pltfm_mgr_qsfp_info_get', TMessageType.CALL, self._seqid) - args = pltfm_mgr_qsfp_info_get_args() - args.port_num = port_num - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_pltfm_mgr_qsfp_info_get(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = pltfm_mgr_qsfp_info_get_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - if result.ouch is not None: - raise result.ouch - raise TApplicationException(TApplicationException.MISSING_RESULT, - "pltfm_mgr_qsfp_info_get failed: unknown result") - - def pltfm_mgr_qsfp_get_max_port(self): - self.send_pltfm_mgr_qsfp_get_max_port() - return self.recv_pltfm_mgr_qsfp_get_max_port() - - def send_pltfm_mgr_qsfp_get_max_port(self): - self._oprot.writeMessageBegin('pltfm_mgr_qsfp_get_max_port', TMessageType.CALL, self._seqid) - args = pltfm_mgr_qsfp_get_max_port_args() - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_pltfm_mgr_qsfp_get_max_port(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = pltfm_mgr_qsfp_get_max_port_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - if result.ouch is not None: - raise result.ouch - raise TApplicationException(TApplicationException.MISSING_RESULT, - "pltfm_mgr_qsfp_get_max_port failed: unknown result") - - def pltfm_mgr_qsfp_reset(self, port_num, reset): - """ - Parameters: - - port_num - - reset - """ - self.send_pltfm_mgr_qsfp_reset(port_num, reset) - return self.recv_pltfm_mgr_qsfp_reset() - - def send_pltfm_mgr_qsfp_reset(self, port_num, reset): - self._oprot.writeMessageBegin('pltfm_mgr_qsfp_reset', TMessageType.CALL, self._seqid) - args = pltfm_mgr_qsfp_reset_args() - args.port_num = port_num - args.reset = reset - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_pltfm_mgr_qsfp_reset(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = pltfm_mgr_qsfp_reset_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - if result.ouch is not None: - raise result.ouch - raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_reset failed: unknown result") - - def pltfm_mgr_qsfp_lpmode_get(self, port_num): - """ - Parameters: - - port_num - """ - self.send_pltfm_mgr_qsfp_lpmode_get(port_num) - return self.recv_pltfm_mgr_qsfp_lpmode_get() - - def send_pltfm_mgr_qsfp_lpmode_get(self, port_num): - self._oprot.writeMessageBegin('pltfm_mgr_qsfp_lpmode_get', TMessageType.CALL, self._seqid) - args = pltfm_mgr_qsfp_lpmode_get_args() - args.port_num = port_num - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_pltfm_mgr_qsfp_lpmode_get(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = pltfm_mgr_qsfp_lpmode_get_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - if result.ouch is not None: - raise result.ouch - raise TApplicationException(TApplicationException.MISSING_RESULT, - "pltfm_mgr_qsfp_lpmode_get failed: unknown result") - - def pltfm_mgr_qsfp_lpmode_set(self, port_num, lpmode): - """ - Parameters: - - port_num - - lpmode - """ - self.send_pltfm_mgr_qsfp_lpmode_set(port_num, lpmode) - return self.recv_pltfm_mgr_qsfp_lpmode_set() - - def send_pltfm_mgr_qsfp_lpmode_set(self, port_num, lpmode): - self._oprot.writeMessageBegin('pltfm_mgr_qsfp_lpmode_set', TMessageType.CALL, self._seqid) - args = pltfm_mgr_qsfp_lpmode_set_args() - args.port_num = port_num - args.lpmode = lpmode - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_pltfm_mgr_qsfp_lpmode_set(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = pltfm_mgr_qsfp_lpmode_set_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - if result.ouch is not None: - raise result.ouch - raise TApplicationException(TApplicationException.MISSING_RESULT, - "pltfm_mgr_qsfp_lpmode_set failed: unknown result") - - def pltfm_mgr_sensor_info_get(self, options): - """ - Parameters: - - options - """ - self.send_pltfm_mgr_sensor_info_get(options) - return self.recv_pltfm_mgr_sensor_info_get() - - def send_pltfm_mgr_sensor_info_get(self, options): - self._oprot.writeMessageBegin('pltfm_mgr_sensor_info_get', TMessageType.CALL, self._seqid) - args = pltfm_mgr_sensor_info_get_args() - args.options = options - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_pltfm_mgr_sensor_info_get(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = pltfm_mgr_sensor_info_get_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - if result.ouch is not None: - raise result.ouch - raise TApplicationException(TApplicationException.MISSING_RESULT, - "pltfm_mgr_sensor_info_get failed: unknown result") - - -class Processor(Iface, TProcessor): - def __init__(self, handler): - self._handler = handler - self._processMap = {} - self._processMap["pltfm_mgr_dummy"] = Processor.process_pltfm_mgr_dummy - self._processMap["pltfm_mgr_sys_tmp_get"] = Processor.process_pltfm_mgr_sys_tmp_get - self._processMap["pltfm_mgr_sys_eeprom_get"] = Processor.process_pltfm_mgr_sys_eeprom_get - self._processMap["pltfm_mgr_pwr_supply_present_get"] = Processor.process_pltfm_mgr_pwr_supply_present_get - self._processMap["pltfm_mgr_pwr_supply_info_get"] = Processor.process_pltfm_mgr_pwr_supply_info_get - self._processMap["pltfm_mgr_pwr_rail_info_get"] = Processor.process_pltfm_mgr_pwr_rail_info_get - self._processMap["pltfm_mgr_fan_speed_set"] = Processor.process_pltfm_mgr_fan_speed_set - self._processMap["pltfm_mgr_fan_info_get"] = Processor.process_pltfm_mgr_fan_info_get - self._processMap["pltfm_mgr_qsfp_presence_get"] = Processor.process_pltfm_mgr_qsfp_presence_get - self._processMap["pltfm_mgr_qsfp_info_get"] = Processor.process_pltfm_mgr_qsfp_info_get - self._processMap["pltfm_mgr_qsfp_get_max_port"] = Processor.process_pltfm_mgr_qsfp_get_max_port - self._processMap["pltfm_mgr_qsfp_reset"] = Processor.process_pltfm_mgr_qsfp_reset - self._processMap["pltfm_mgr_qsfp_lpmode_get"] = Processor.process_pltfm_mgr_qsfp_lpmode_get - self._processMap["pltfm_mgr_qsfp_lpmode_set"] = Processor.process_pltfm_mgr_qsfp_lpmode_set - self._processMap["pltfm_mgr_sensor_info_get"] = Processor.process_pltfm_mgr_sensor_info_get - - def process(self, iprot, oprot): - (name, type, seqid) = iprot.readMessageBegin() - if name not in self._processMap: - iprot.skip(TType.STRUCT) - iprot.readMessageEnd() - x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) - oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) - x.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - return - else: - self._processMap[name](self, seqid, iprot, oprot) - return True - - def process_pltfm_mgr_dummy(self, seqid, iprot, oprot): - args = pltfm_mgr_dummy_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_dummy_result() - try: - result.success = self._handler.pltfm_mgr_dummy(args.device) - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_dummy", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_pltfm_mgr_sys_tmp_get(self, seqid, iprot, oprot): - args = pltfm_mgr_sys_tmp_get_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_sys_tmp_get_result() - try: - result.success = self._handler.pltfm_mgr_sys_tmp_get() - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_sys_tmp_get", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_pltfm_mgr_sys_eeprom_get(self, seqid, iprot, oprot): - args = pltfm_mgr_sys_eeprom_get_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_sys_eeprom_get_result() - try: - result.success = self._handler.pltfm_mgr_sys_eeprom_get() - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_sys_eeprom_get", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_pltfm_mgr_pwr_supply_present_get(self, seqid, iprot, oprot): - args = pltfm_mgr_pwr_supply_present_get_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_pwr_supply_present_get_result() - try: - result.success = self._handler.pltfm_mgr_pwr_supply_present_get(args.ps_num) - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_pwr_supply_present_get", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_pltfm_mgr_pwr_supply_info_get(self, seqid, iprot, oprot): - args = pltfm_mgr_pwr_supply_info_get_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_pwr_supply_info_get_result() - try: - result.success = self._handler.pltfm_mgr_pwr_supply_info_get(args.ps_num) - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_pwr_supply_info_get", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_pltfm_mgr_pwr_rail_info_get(self, seqid, iprot, oprot): - args = pltfm_mgr_pwr_rail_info_get_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_pwr_rail_info_get_result() - try: - result.success = self._handler.pltfm_mgr_pwr_rail_info_get(args.ps_num) - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_pwr_rail_info_get", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_pltfm_mgr_fan_speed_set(self, seqid, iprot, oprot): - args = pltfm_mgr_fan_speed_set_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_fan_speed_set_result() - try: - result.success = self._handler.pltfm_mgr_fan_speed_set(args.fan_num, args.percent) - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_fan_speed_set", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_pltfm_mgr_fan_info_get(self, seqid, iprot, oprot): - args = pltfm_mgr_fan_info_get_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_fan_info_get_result() - try: - result.success = self._handler.pltfm_mgr_fan_info_get(args.fan_num) - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_fan_info_get", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_pltfm_mgr_qsfp_presence_get(self, seqid, iprot, oprot): - args = pltfm_mgr_qsfp_presence_get_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_qsfp_presence_get_result() - try: - result.success = self._handler.pltfm_mgr_qsfp_presence_get(args.port_num) - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_qsfp_presence_get", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_pltfm_mgr_qsfp_info_get(self, seqid, iprot, oprot): - args = pltfm_mgr_qsfp_info_get_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_qsfp_info_get_result() - try: - result.success = self._handler.pltfm_mgr_qsfp_info_get(args.port_num) - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_qsfp_info_get", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_pltfm_mgr_qsfp_get_max_port(self, seqid, iprot, oprot): - args = pltfm_mgr_qsfp_get_max_port_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_qsfp_get_max_port_result() - try: - result.success = self._handler.pltfm_mgr_qsfp_get_max_port() - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_qsfp_get_max_port", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_pltfm_mgr_qsfp_reset(self, seqid, iprot, oprot): - args = pltfm_mgr_qsfp_reset_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_qsfp_reset_result() - try: - result.success = self._handler.pltfm_mgr_qsfp_reset(args.port_num, args.reset) - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_qsfp_reset", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_pltfm_mgr_qsfp_lpmode_get(self, seqid, iprot, oprot): - args = pltfm_mgr_qsfp_lpmode_get_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_qsfp_lpmode_get_result() - try: - result.success = self._handler.pltfm_mgr_qsfp_lpmode_get(args.port_num) - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_qsfp_lpmode_get", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_pltfm_mgr_qsfp_lpmode_set(self, seqid, iprot, oprot): - args = pltfm_mgr_qsfp_lpmode_set_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_qsfp_lpmode_set_result() - try: - result.success = self._handler.pltfm_mgr_qsfp_lpmode_set(args.port_num, args.lpmode) - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_qsfp_lpmode_set", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_pltfm_mgr_sensor_info_get(self, seqid, iprot, oprot): - args = pltfm_mgr_sensor_info_get_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_sensor_info_get_result() - try: - result.success = self._handler.pltfm_mgr_sensor_info_get(args.options) - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_sensor_info_get", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - -# HELPER FUNCTIONS AND STRUCTURES - - -class pltfm_mgr_dummy_args(object): - """ - Attributes: - - device - """ - - thrift_spec = ( - None, # 0 - (1, TType.BYTE, 'device', None, None, ), # 1 - ) - - def __init__(self, device=None,): - self.device = device - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.BYTE: - self.device = iprot.readByte() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_dummy_args') - if self.device is not None: - oprot.writeFieldBegin('device', TType.BYTE, 1) - oprot.writeByte(self.device) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_dummy_result(object): - """ - Attributes: - - success - """ - - thrift_spec = ( - (0, TType.I32, 'success', None, None, ), # 0 - ) - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.I32: - self.success = iprot.readI32() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_dummy_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.I32, 0) - oprot.writeI32(self.success) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_sys_tmp_get_args(object): - - thrift_spec = ( - ) - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_sys_tmp_get_args') - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_sys_tmp_get_result(object): - """ - Attributes: - - success - - ouch - """ - - thrift_spec = ( - (0, TType.STRUCT, 'success', (pltfm_mgr_sys_tmp_t, pltfm_mgr_sys_tmp_t.thrift_spec), None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) - - def __init__(self, success=None, ouch=None,): - self.success = success - self.ouch = ouch - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.STRUCT: - self.success = pltfm_mgr_sys_tmp_t() - self.success.read(iprot) - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_sys_tmp_get_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.STRUCT, 0) - self.success.write(oprot) - oprot.writeFieldEnd() - if self.ouch is not None: - oprot.writeFieldBegin('ouch', TType.STRUCT, 1) - self.ouch.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_sys_eeprom_get_args(object): - - thrift_spec = ( - ) - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_sys_eeprom_get_args') - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_sys_eeprom_get_result(object): - """ - Attributes: - - success - - ouch - """ - - thrift_spec = ( - (0, TType.STRUCT, 'success', (pltfm_mgr_eeprom_t, pltfm_mgr_eeprom_t.thrift_spec), None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) - - def __init__(self, success=None, ouch=None,): - self.success = success - self.ouch = ouch - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.STRUCT: - self.success = pltfm_mgr_eeprom_t() - self.success.read(iprot) - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_sys_eeprom_get_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.STRUCT, 0) - self.success.write(oprot) - oprot.writeFieldEnd() - if self.ouch is not None: - oprot.writeFieldBegin('ouch', TType.STRUCT, 1) - self.ouch.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_pwr_supply_present_get_args(object): - """ - Attributes: - - ps_num - """ - - thrift_spec = ( - None, # 0 - (1, TType.I16, 'ps_num', None, None, ), # 1 - ) - - def __init__(self, ps_num=None,): - self.ps_num = ps_num - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.I16: - self.ps_num = iprot.readI16() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_pwr_supply_present_get_args') - if self.ps_num is not None: - oprot.writeFieldBegin('ps_num', TType.I16, 1) - oprot.writeI16(self.ps_num) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_pwr_supply_present_get_result(object): - """ - Attributes: - - success - - ouch - """ - - thrift_spec = ( - (0, TType.BOOL, 'success', None, None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) - - def __init__(self, success=None, ouch=None,): - self.success = success - self.ouch = ouch - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.BOOL: - self.success = iprot.readBool() - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_pwr_supply_present_get_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.BOOL, 0) - oprot.writeBool(self.success) - oprot.writeFieldEnd() - if self.ouch is not None: - oprot.writeFieldBegin('ouch', TType.STRUCT, 1) - self.ouch.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_pwr_supply_info_get_args(object): - """ - Attributes: - - ps_num - """ - - thrift_spec = ( - None, # 0 - (1, TType.I16, 'ps_num', None, None, ), # 1 - ) - - def __init__(self, ps_num=None,): - self.ps_num = ps_num - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.I16: - self.ps_num = iprot.readI16() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_pwr_supply_info_get_args') - if self.ps_num is not None: - oprot.writeFieldBegin('ps_num', TType.I16, 1) - oprot.writeI16(self.ps_num) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_pwr_supply_info_get_result(object): - """ - Attributes: - - success - - ouch - """ - - thrift_spec = ( - (0, TType.STRUCT, 'success', (pltfm_mgr_pwr_supply_info_t, pltfm_mgr_pwr_supply_info_t.thrift_spec), None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) - - def __init__(self, success=None, ouch=None,): - self.success = success - self.ouch = ouch - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.STRUCT: - self.success = pltfm_mgr_pwr_supply_info_t() - self.success.read(iprot) - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_pwr_supply_info_get_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.STRUCT, 0) - self.success.write(oprot) - oprot.writeFieldEnd() - if self.ouch is not None: - oprot.writeFieldBegin('ouch', TType.STRUCT, 1) - self.ouch.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_pwr_rail_info_get_args(object): - """ - Attributes: - - ps_num - """ - - thrift_spec = ( - None, # 0 - (1, TType.I16, 'ps_num', None, None, ), # 1 - ) - - def __init__(self, ps_num=None,): - self.ps_num = ps_num - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.I16: - self.ps_num = iprot.readI16() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_pwr_rail_info_get_args') - if self.ps_num is not None: - oprot.writeFieldBegin('ps_num', TType.I16, 1) - oprot.writeI16(self.ps_num) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_pwr_rail_info_get_result(object): - """ - Attributes: - - success - - ouch - """ - - thrift_spec = ( - (0, TType.STRUCT, 'success', (pltfm_mgr_pwr_rail_info_t, pltfm_mgr_pwr_rail_info_t.thrift_spec), None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) - - def __init__(self, success=None, ouch=None,): - self.success = success - self.ouch = ouch - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.STRUCT: - self.success = pltfm_mgr_pwr_rail_info_t() - self.success.read(iprot) - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_pwr_rail_info_get_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.STRUCT, 0) - self.success.write(oprot) - oprot.writeFieldEnd() - if self.ouch is not None: - oprot.writeFieldBegin('ouch', TType.STRUCT, 1) - self.ouch.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_fan_speed_set_args(object): - """ - Attributes: - - fan_num - - percent - """ - - thrift_spec = ( - None, # 0 - (1, TType.I32, 'fan_num', None, None, ), # 1 - (2, TType.I32, 'percent', None, None, ), # 2 - ) - - def __init__(self, fan_num=None, percent=None,): - self.fan_num = fan_num - self.percent = percent - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.I32: - self.fan_num = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.I32: - self.percent = iprot.readI32() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_fan_speed_set_args') - if self.fan_num is not None: - oprot.writeFieldBegin('fan_num', TType.I32, 1) - oprot.writeI32(self.fan_num) - oprot.writeFieldEnd() - if self.percent is not None: - oprot.writeFieldBegin('percent', TType.I32, 2) - oprot.writeI32(self.percent) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_fan_speed_set_result(object): - """ - Attributes: - - success - - ouch - """ - - thrift_spec = ( - (0, TType.I32, 'success', None, None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) - - def __init__(self, success=None, ouch=None,): - self.success = success - self.ouch = ouch - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.I32: - self.success = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_fan_speed_set_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.I32, 0) - oprot.writeI32(self.success) - oprot.writeFieldEnd() - if self.ouch is not None: - oprot.writeFieldBegin('ouch', TType.STRUCT, 1) - self.ouch.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_fan_info_get_args(object): - """ - Attributes: - - fan_num - """ - - thrift_spec = ( - None, # 0 - (1, TType.I32, 'fan_num', None, None, ), # 1 - ) - - def __init__(self, fan_num=None,): - self.fan_num = fan_num - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.I32: - self.fan_num = iprot.readI32() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_fan_info_get_args') - if self.fan_num is not None: - oprot.writeFieldBegin('fan_num', TType.I32, 1) - oprot.writeI32(self.fan_num) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_fan_info_get_result(object): - """ - Attributes: - - success - - ouch - """ - - thrift_spec = ( - (0, TType.STRUCT, 'success', (pltfm_mgr_fan_info_t, pltfm_mgr_fan_info_t.thrift_spec), None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) - - def __init__(self, success=None, ouch=None,): - self.success = success - self.ouch = ouch - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.STRUCT: - self.success = pltfm_mgr_fan_info_t() - self.success.read(iprot) - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_fan_info_get_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.STRUCT, 0) - self.success.write(oprot) - oprot.writeFieldEnd() - if self.ouch is not None: - oprot.writeFieldBegin('ouch', TType.STRUCT, 1) - self.ouch.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_qsfp_presence_get_args(object): - """ - Attributes: - - port_num - """ - - thrift_spec = ( - None, # 0 - (1, TType.I32, 'port_num', None, None, ), # 1 - ) - - def __init__(self, port_num=None,): - self.port_num = port_num - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.I32: - self.port_num = iprot.readI32() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_qsfp_presence_get_args') - if self.port_num is not None: - oprot.writeFieldBegin('port_num', TType.I32, 1) - oprot.writeI32(self.port_num) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_qsfp_presence_get_result(object): - """ - Attributes: - - success - - ouch - """ - - thrift_spec = ( - (0, TType.BOOL, 'success', None, None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) - - def __init__(self, success=None, ouch=None,): - self.success = success - self.ouch = ouch - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.BOOL: - self.success = iprot.readBool() - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_qsfp_presence_get_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.BOOL, 0) - oprot.writeBool(self.success) - oprot.writeFieldEnd() - if self.ouch is not None: - oprot.writeFieldBegin('ouch', TType.STRUCT, 1) - self.ouch.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_qsfp_info_get_args(object): - """ - Attributes: - - port_num - """ - - thrift_spec = ( - None, # 0 - (1, TType.I32, 'port_num', None, None, ), # 1 - ) - - def __init__(self, port_num=None,): - self.port_num = port_num - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.I32: - self.port_num = iprot.readI32() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_qsfp_info_get_args') - if self.port_num is not None: - oprot.writeFieldBegin('port_num', TType.I32, 1) - oprot.writeI32(self.port_num) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_qsfp_info_get_result(object): - """ - Attributes: - - success - - ouch - """ - - thrift_spec = ( - (0, TType.STRING, 'success', 'UTF8', None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) - - def __init__(self, success=None, ouch=None,): - self.success = success - self.ouch = ouch - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.STRING: - self.success = iprot.readString().decode( - 'utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_qsfp_info_get_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.STRING, 0) - oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) - oprot.writeFieldEnd() - if self.ouch is not None: - oprot.writeFieldBegin('ouch', TType.STRUCT, 1) - self.ouch.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_qsfp_get_max_port_args(object): - - thrift_spec = ( - ) - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_qsfp_get_max_port_args') - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_qsfp_get_max_port_result(object): - """ - Attributes: - - success - - ouch - """ - - thrift_spec = ( - (0, TType.I32, 'success', None, None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) - - def __init__(self, success=None, ouch=None,): - self.success = success - self.ouch = ouch - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.I32: - self.success = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_qsfp_get_max_port_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.I32, 0) - oprot.writeI32(self.success) - oprot.writeFieldEnd() - if self.ouch is not None: - oprot.writeFieldBegin('ouch', TType.STRUCT, 1) - self.ouch.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_qsfp_reset_args(object): - """ - Attributes: - - port_num - - reset - """ - - thrift_spec = ( - None, # 0 - (1, TType.I32, 'port_num', None, None, ), # 1 - (2, TType.BOOL, 'reset', None, None, ), # 2 - ) - - def __init__(self, port_num=None, reset=None,): - self.port_num = port_num - self.reset = reset - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.I32: - self.port_num = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.BOOL: - self.reset = iprot.readBool() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_qsfp_reset_args') - if self.port_num is not None: - oprot.writeFieldBegin('port_num', TType.I32, 1) - oprot.writeI32(self.port_num) - oprot.writeFieldEnd() - if self.reset is not None: - oprot.writeFieldBegin('reset', TType.BOOL, 2) - oprot.writeBool(self.reset) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_qsfp_reset_result(object): - """ - Attributes: - - success - - ouch - """ - - thrift_spec = ( - (0, TType.I32, 'success', None, None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) - - def __init__(self, success=None, ouch=None,): - self.success = success - self.ouch = ouch - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.I32: - self.success = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_qsfp_reset_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.I32, 0) - oprot.writeI32(self.success) - oprot.writeFieldEnd() - if self.ouch is not None: - oprot.writeFieldBegin('ouch', TType.STRUCT, 1) - self.ouch.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_qsfp_lpmode_get_args(object): - """ - Attributes: - - port_num - """ - - thrift_spec = ( - None, # 0 - (1, TType.I32, 'port_num', None, None, ), # 1 - ) - - def __init__(self, port_num=None,): - self.port_num = port_num - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.I32: - self.port_num = iprot.readI32() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_qsfp_lpmode_get_args') - if self.port_num is not None: - oprot.writeFieldBegin('port_num', TType.I32, 1) - oprot.writeI32(self.port_num) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_qsfp_lpmode_get_result(object): - """ - Attributes: - - success - - ouch - """ - - thrift_spec = ( - (0, TType.BOOL, 'success', None, None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) - - def __init__(self, success=None, ouch=None,): - self.success = success - self.ouch = ouch - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.BOOL: - self.success = iprot.readBool() - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_qsfp_lpmode_get_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.BOOL, 0) - oprot.writeBool(self.success) - oprot.writeFieldEnd() - if self.ouch is not None: - oprot.writeFieldBegin('ouch', TType.STRUCT, 1) - self.ouch.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_qsfp_lpmode_set_args(object): - """ - Attributes: - - port_num - - lpmode - """ - - thrift_spec = ( - None, # 0 - (1, TType.I32, 'port_num', None, None, ), # 1 - (2, TType.BOOL, 'lpmode', None, None, ), # 2 - ) - - def __init__(self, port_num=None, lpmode=None,): - self.port_num = port_num - self.lpmode = lpmode - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.I32: - self.port_num = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.BOOL: - self.lpmode = iprot.readBool() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_qsfp_lpmode_set_args') - if self.port_num is not None: - oprot.writeFieldBegin('port_num', TType.I32, 1) - oprot.writeI32(self.port_num) - oprot.writeFieldEnd() - if self.lpmode is not None: - oprot.writeFieldBegin('lpmode', TType.BOOL, 2) - oprot.writeBool(self.lpmode) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_qsfp_lpmode_set_result(object): - """ - Attributes: - - success - - ouch - """ - - thrift_spec = ( - (0, TType.I32, 'success', None, None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) - - def __init__(self, success=None, ouch=None,): - self.success = success - self.ouch = ouch - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.I32: - self.success = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_qsfp_lpmode_set_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.I32, 0) - oprot.writeI32(self.success) - oprot.writeFieldEnd() - if self.ouch is not None: - oprot.writeFieldBegin('ouch', TType.STRUCT, 1) - self.ouch.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_sensor_info_get_args(object): - """ - Attributes: - - options - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'options', 'UTF8', None, ), # 1 - ) - - def __init__(self, options=None,): - self.options = options - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.options = iprot.readString().decode( - 'utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_sensor_info_get_args') - if self.options is not None: - oprot.writeFieldBegin('options', TType.STRING, 1) - oprot.writeString(self.options.encode('utf-8') if sys.version_info[0] == 2 else self.options) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_sensor_info_get_result(object): - """ - Attributes: - - success - - ouch - """ - - thrift_spec = ( - (0, TType.STRING, 'success', 'UTF8', None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) - - def __init__(self, success=None, ouch=None,): - self.success = success - self.ouch = ouch - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.STRING: - self.success = iprot.readString().decode( - 'utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_sensor_info_get_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.STRING, 0) - oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) - oprot.writeFieldEnd() - if self.ouch is not None: - oprot.writeFieldBegin('ouch', TType.STRUCT, 1) - self.ouch.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/pltfm_mgr_rpc/ttypes.py b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/pltfm_mgr_rpc/ttypes.py deleted file mode 100644 index 1f88c3c1f9..0000000000 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/pltfm_mgr_rpc/ttypes.py +++ /dev/null @@ -1,1081 +0,0 @@ -# -# Autogenerated by Thrift Compiler (0.10.0) -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# -# options string: py -# - -from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException -from thrift.protocol.TProtocol import TProtocolException -import sys - -from thrift.transport import TTransport - - -class pltfm_mgr_sys_tmp_t(object): - """ - Attributes: - - tmp1 - - tmp2 - - tmp3 - - tmp4 - - tmp5 - - tmp6 - - tmp7 - - tmp8 - - tmp9 - - tmp10 - """ - - thrift_spec = ( - None, # 0 - (1, TType.DOUBLE, 'tmp1', None, None, ), # 1 - (2, TType.DOUBLE, 'tmp2', None, None, ), # 2 - (3, TType.DOUBLE, 'tmp3', None, None, ), # 3 - (4, TType.DOUBLE, 'tmp4', None, None, ), # 4 - (5, TType.DOUBLE, 'tmp5', None, None, ), # 5 - (6, TType.DOUBLE, 'tmp6', None, None, ), # 6 - (7, TType.DOUBLE, 'tmp7', None, None, ), # 7 - (8, TType.DOUBLE, 'tmp8', None, None, ), # 8 - (9, TType.DOUBLE, 'tmp9', None, None, ), # 9 - (10, TType.DOUBLE, 'tmp10', None, None, ), # 10 - ) - - def __init__(self, tmp1=None, tmp2=None, tmp3=None, tmp4=None, tmp5=None, tmp6=None, tmp7=None, tmp8=None, tmp9=None, tmp10=None,): - self.tmp1 = tmp1 - self.tmp2 = tmp2 - self.tmp3 = tmp3 - self.tmp4 = tmp4 - self.tmp5 = tmp5 - self.tmp6 = tmp6 - self.tmp7 = tmp7 - self.tmp8 = tmp8 - self.tmp9 = tmp9 - self.tmp10 = tmp10 - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.DOUBLE: - self.tmp1 = iprot.readDouble() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.DOUBLE: - self.tmp2 = iprot.readDouble() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.DOUBLE: - self.tmp3 = iprot.readDouble() - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.DOUBLE: - self.tmp4 = iprot.readDouble() - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.DOUBLE: - self.tmp5 = iprot.readDouble() - else: - iprot.skip(ftype) - elif fid == 6: - if ftype == TType.DOUBLE: - self.tmp6 = iprot.readDouble() - else: - iprot.skip(ftype) - elif fid == 7: - if ftype == TType.DOUBLE: - self.tmp7 = iprot.readDouble() - else: - iprot.skip(ftype) - elif fid == 8: - if ftype == TType.DOUBLE: - self.tmp8 = iprot.readDouble() - else: - iprot.skip(ftype) - elif fid == 9: - if ftype == TType.DOUBLE: - self.tmp9 = iprot.readDouble() - else: - iprot.skip(ftype) - elif fid == 10: - if ftype == TType.DOUBLE: - self.tmp10 = iprot.readDouble() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_sys_tmp_t') - if self.tmp1 is not None: - oprot.writeFieldBegin('tmp1', TType.DOUBLE, 1) - oprot.writeDouble(self.tmp1) - oprot.writeFieldEnd() - if self.tmp2 is not None: - oprot.writeFieldBegin('tmp2', TType.DOUBLE, 2) - oprot.writeDouble(self.tmp2) - oprot.writeFieldEnd() - if self.tmp3 is not None: - oprot.writeFieldBegin('tmp3', TType.DOUBLE, 3) - oprot.writeDouble(self.tmp3) - oprot.writeFieldEnd() - if self.tmp4 is not None: - oprot.writeFieldBegin('tmp4', TType.DOUBLE, 4) - oprot.writeDouble(self.tmp4) - oprot.writeFieldEnd() - if self.tmp5 is not None: - oprot.writeFieldBegin('tmp5', TType.DOUBLE, 5) - oprot.writeDouble(self.tmp5) - oprot.writeFieldEnd() - if self.tmp6 is not None: - oprot.writeFieldBegin('tmp6', TType.DOUBLE, 6) - oprot.writeDouble(self.tmp6) - oprot.writeFieldEnd() - if self.tmp7 is not None: - oprot.writeFieldBegin('tmp7', TType.DOUBLE, 7) - oprot.writeDouble(self.tmp7) - oprot.writeFieldEnd() - if self.tmp8 is not None: - oprot.writeFieldBegin('tmp8', TType.DOUBLE, 8) - oprot.writeDouble(self.tmp8) - oprot.writeFieldEnd() - if self.tmp9 is not None: - oprot.writeFieldBegin('tmp9', TType.DOUBLE, 9) - oprot.writeDouble(self.tmp9) - oprot.writeFieldEnd() - if self.tmp10 is not None: - oprot.writeFieldBegin('tmp10', TType.DOUBLE, 10) - oprot.writeDouble(self.tmp10) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_eeprom_t(object): - """ - Attributes: - - version - - prod_name - - prod_part_num - - sys_asm_part_num - - bfn_pcba_part_num - - bfn_pcbb_part_num - - odm_pcba_part_num - - odm_pcba_ser_num - - prod_state - - prod_ver - - prod_sub_ver - - prod_ser_num - - prod_ast_tag - - sys_mfger - - sys_mfg_date - - pcb_mfger - - assembled_at - - loc_mac_addr - - ext_mac_addr - - ext_mac_addr_size - - location - - crc8 - """ - - thrift_spec = ( - None, # 0 - (1, TType.I16, 'version', None, None, ), # 1 - (2, TType.STRING, 'prod_name', 'UTF8', None, ), # 2 - (3, TType.STRING, 'prod_part_num', 'UTF8', None, ), # 3 - (4, TType.STRING, 'sys_asm_part_num', 'UTF8', None, ), # 4 - (5, TType.STRING, 'bfn_pcba_part_num', 'UTF8', None, ), # 5 - (6, TType.STRING, 'bfn_pcbb_part_num', 'UTF8', None, ), # 6 - (7, TType.STRING, 'odm_pcba_part_num', 'UTF8', None, ), # 7 - (8, TType.STRING, 'odm_pcba_ser_num', 'UTF8', None, ), # 8 - (9, TType.I16, 'prod_state', None, None, ), # 9 - (10, TType.I16, 'prod_ver', None, None, ), # 10 - (11, TType.I16, 'prod_sub_ver', None, None, ), # 11 - (12, TType.STRING, 'prod_ser_num', 'UTF8', None, ), # 12 - (13, TType.STRING, 'prod_ast_tag', 'UTF8', None, ), # 13 - (14, TType.STRING, 'sys_mfger', 'UTF8', None, ), # 14 - (15, TType.STRING, 'sys_mfg_date', 'UTF8', None, ), # 15 - (16, TType.STRING, 'pcb_mfger', 'UTF8', None, ), # 16 - (17, TType.STRING, 'assembled_at', 'UTF8', None, ), # 17 - (18, TType.STRING, 'loc_mac_addr', 'UTF8', None, ), # 18 - (19, TType.STRING, 'ext_mac_addr', 'UTF8', None, ), # 19 - (20, TType.I32, 'ext_mac_addr_size', None, None, ), # 20 - (21, TType.STRING, 'location', 'UTF8', None, ), # 21 - (22, TType.I16, 'crc8', None, None, ), # 22 - ) - - def __init__(self, version=None, prod_name=None, prod_part_num=None, sys_asm_part_num=None, bfn_pcba_part_num=None, bfn_pcbb_part_num=None, odm_pcba_part_num=None, odm_pcba_ser_num=None, prod_state=None, prod_ver=None, prod_sub_ver=None, prod_ser_num=None, prod_ast_tag=None, sys_mfger=None, sys_mfg_date=None, pcb_mfger=None, assembled_at=None, loc_mac_addr=None, ext_mac_addr=None, ext_mac_addr_size=None, location=None, crc8=None,): - self.version = version - self.prod_name = prod_name - self.prod_part_num = prod_part_num - self.sys_asm_part_num = sys_asm_part_num - self.bfn_pcba_part_num = bfn_pcba_part_num - self.bfn_pcbb_part_num = bfn_pcbb_part_num - self.odm_pcba_part_num = odm_pcba_part_num - self.odm_pcba_ser_num = odm_pcba_ser_num - self.prod_state = prod_state - self.prod_ver = prod_ver - self.prod_sub_ver = prod_sub_ver - self.prod_ser_num = prod_ser_num - self.prod_ast_tag = prod_ast_tag - self.sys_mfger = sys_mfger - self.sys_mfg_date = sys_mfg_date - self.pcb_mfger = pcb_mfger - self.assembled_at = assembled_at - self.loc_mac_addr = loc_mac_addr - self.ext_mac_addr = ext_mac_addr - self.ext_mac_addr_size = ext_mac_addr_size - self.location = location - self.crc8 = crc8 - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.I16: - self.version = iprot.readI16() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.prod_name = iprot.readString().decode( - 'utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRING: - self.prod_part_num = iprot.readString().decode( - 'utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.STRING: - self.sys_asm_part_num = iprot.readString().decode( - 'utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.STRING: - self.bfn_pcba_part_num = iprot.readString().decode( - 'utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 6: - if ftype == TType.STRING: - self.bfn_pcbb_part_num = iprot.readString().decode( - 'utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 7: - if ftype == TType.STRING: - self.odm_pcba_part_num = iprot.readString().decode( - 'utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 8: - if ftype == TType.STRING: - self.odm_pcba_ser_num = iprot.readString().decode( - 'utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 9: - if ftype == TType.I16: - self.prod_state = iprot.readI16() - else: - iprot.skip(ftype) - elif fid == 10: - if ftype == TType.I16: - self.prod_ver = iprot.readI16() - else: - iprot.skip(ftype) - elif fid == 11: - if ftype == TType.I16: - self.prod_sub_ver = iprot.readI16() - else: - iprot.skip(ftype) - elif fid == 12: - if ftype == TType.STRING: - self.prod_ser_num = iprot.readString().decode( - 'utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 13: - if ftype == TType.STRING: - self.prod_ast_tag = iprot.readString().decode( - 'utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 14: - if ftype == TType.STRING: - self.sys_mfger = iprot.readString().decode( - 'utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 15: - if ftype == TType.STRING: - self.sys_mfg_date = iprot.readString().decode( - 'utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 16: - if ftype == TType.STRING: - self.pcb_mfger = iprot.readString().decode( - 'utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 17: - if ftype == TType.STRING: - self.assembled_at = iprot.readString().decode( - 'utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 18: - if ftype == TType.STRING: - self.loc_mac_addr = iprot.readString().decode( - 'utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 19: - if ftype == TType.STRING: - self.ext_mac_addr = iprot.readString().decode( - 'utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 20: - if ftype == TType.I32: - self.ext_mac_addr_size = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 21: - if ftype == TType.STRING: - self.location = iprot.readString().decode( - 'utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 22: - if ftype == TType.I16: - self.crc8 = iprot.readI16() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_eeprom_t') - if self.version is not None: - oprot.writeFieldBegin('version', TType.I16, 1) - oprot.writeI16(self.version) - oprot.writeFieldEnd() - if self.prod_name is not None: - oprot.writeFieldBegin('prod_name', TType.STRING, 2) - oprot.writeString(self.prod_name.encode('utf-8') if sys.version_info[0] == 2 else self.prod_name) - oprot.writeFieldEnd() - if self.prod_part_num is not None: - oprot.writeFieldBegin('prod_part_num', TType.STRING, 3) - oprot.writeString(self.prod_part_num.encode('utf-8') if sys.version_info[0] == 2 else self.prod_part_num) - oprot.writeFieldEnd() - if self.sys_asm_part_num is not None: - oprot.writeFieldBegin('sys_asm_part_num', TType.STRING, 4) - oprot.writeString(self.sys_asm_part_num.encode('utf-8') - if sys.version_info[0] == 2 else self.sys_asm_part_num) - oprot.writeFieldEnd() - if self.bfn_pcba_part_num is not None: - oprot.writeFieldBegin('bfn_pcba_part_num', TType.STRING, 5) - oprot.writeString(self.bfn_pcba_part_num.encode('utf-8') - if sys.version_info[0] == 2 else self.bfn_pcba_part_num) - oprot.writeFieldEnd() - if self.bfn_pcbb_part_num is not None: - oprot.writeFieldBegin('bfn_pcbb_part_num', TType.STRING, 6) - oprot.writeString(self.bfn_pcbb_part_num.encode('utf-8') - if sys.version_info[0] == 2 else self.bfn_pcbb_part_num) - oprot.writeFieldEnd() - if self.odm_pcba_part_num is not None: - oprot.writeFieldBegin('odm_pcba_part_num', TType.STRING, 7) - oprot.writeString(self.odm_pcba_part_num.encode('utf-8') - if sys.version_info[0] == 2 else self.odm_pcba_part_num) - oprot.writeFieldEnd() - if self.odm_pcba_ser_num is not None: - oprot.writeFieldBegin('odm_pcba_ser_num', TType.STRING, 8) - oprot.writeString(self.odm_pcba_ser_num.encode('utf-8') - if sys.version_info[0] == 2 else self.odm_pcba_ser_num) - oprot.writeFieldEnd() - if self.prod_state is not None: - oprot.writeFieldBegin('prod_state', TType.I16, 9) - oprot.writeI16(self.prod_state) - oprot.writeFieldEnd() - if self.prod_ver is not None: - oprot.writeFieldBegin('prod_ver', TType.I16, 10) - oprot.writeI16(self.prod_ver) - oprot.writeFieldEnd() - if self.prod_sub_ver is not None: - oprot.writeFieldBegin('prod_sub_ver', TType.I16, 11) - oprot.writeI16(self.prod_sub_ver) - oprot.writeFieldEnd() - if self.prod_ser_num is not None: - oprot.writeFieldBegin('prod_ser_num', TType.STRING, 12) - oprot.writeString(self.prod_ser_num.encode('utf-8') if sys.version_info[0] == 2 else self.prod_ser_num) - oprot.writeFieldEnd() - if self.prod_ast_tag is not None: - oprot.writeFieldBegin('prod_ast_tag', TType.STRING, 13) - oprot.writeString(self.prod_ast_tag.encode('utf-8') if sys.version_info[0] == 2 else self.prod_ast_tag) - oprot.writeFieldEnd() - if self.sys_mfger is not None: - oprot.writeFieldBegin('sys_mfger', TType.STRING, 14) - oprot.writeString(self.sys_mfger.encode('utf-8') if sys.version_info[0] == 2 else self.sys_mfger) - oprot.writeFieldEnd() - if self.sys_mfg_date is not None: - oprot.writeFieldBegin('sys_mfg_date', TType.STRING, 15) - oprot.writeString(self.sys_mfg_date.encode('utf-8') if sys.version_info[0] == 2 else self.sys_mfg_date) - oprot.writeFieldEnd() - if self.pcb_mfger is not None: - oprot.writeFieldBegin('pcb_mfger', TType.STRING, 16) - oprot.writeString(self.pcb_mfger.encode('utf-8') if sys.version_info[0] == 2 else self.pcb_mfger) - oprot.writeFieldEnd() - if self.assembled_at is not None: - oprot.writeFieldBegin('assembled_at', TType.STRING, 17) - oprot.writeString(self.assembled_at.encode('utf-8') if sys.version_info[0] == 2 else self.assembled_at) - oprot.writeFieldEnd() - if self.loc_mac_addr is not None: - oprot.writeFieldBegin('loc_mac_addr', TType.STRING, 18) - oprot.writeString(self.loc_mac_addr.encode('utf-8') if sys.version_info[0] == 2 else self.loc_mac_addr) - oprot.writeFieldEnd() - if self.ext_mac_addr is not None: - oprot.writeFieldBegin('ext_mac_addr', TType.STRING, 19) - oprot.writeString(self.ext_mac_addr.encode('utf-8') if sys.version_info[0] == 2 else self.ext_mac_addr) - oprot.writeFieldEnd() - if self.ext_mac_addr_size is not None: - oprot.writeFieldBegin('ext_mac_addr_size', TType.I32, 20) - oprot.writeI32(self.ext_mac_addr_size) - oprot.writeFieldEnd() - if self.location is not None: - oprot.writeFieldBegin('location', TType.STRING, 21) - oprot.writeString(self.location.encode('utf-8') if sys.version_info[0] == 2 else self.location) - oprot.writeFieldEnd() - if self.crc8 is not None: - oprot.writeFieldBegin('crc8', TType.I16, 22) - oprot.writeI16(self.crc8) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_pwr_supply_info_t(object): - """ - Attributes: - - vin - - vout - - iout - - pwr_out - - fspeed - - ffault - - load_sharing - - model - - serial - - rev - """ - - thrift_spec = ( - None, # 0 - (1, TType.I32, 'vin', None, None, ), # 1 - (2, TType.I32, 'vout', None, None, ), # 2 - (3, TType.I32, 'iout', None, None, ), # 3 - (4, TType.I32, 'pwr_out', None, None, ), # 4 - (5, TType.I32, 'fspeed', None, None, ), # 5 - (6, TType.BOOL, 'ffault', None, None, ), # 6 - (7, TType.BOOL, 'load_sharing', None, None, ), # 7 - (8, TType.STRING, 'model', 'UTF8', None, ), # 8 - (9, TType.STRING, 'serial', 'UTF8', None, ), # 9 - (10, TType.STRING, 'rev', 'UTF8', None, ), # 10 - ) - - def __init__(self, vin=None, vout=None, iout=None, pwr_out=None, fspeed=None, ffault=None, load_sharing=None, model=None, serial=None, rev=None,): - self.vin = vin - self.vout = vout - self.iout = iout - self.pwr_out = pwr_out - self.fspeed = fspeed - self.ffault = ffault - self.load_sharing = load_sharing - self.model = model - self.serial = serial - self.rev = rev - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.I32: - self.vin = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.I32: - self.vout = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.I32: - self.iout = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.I32: - self.pwr_out = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.I32: - self.fspeed = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 6: - if ftype == TType.BOOL: - self.ffault = iprot.readBool() - else: - iprot.skip(ftype) - elif fid == 7: - if ftype == TType.BOOL: - self.load_sharing = iprot.readBool() - else: - iprot.skip(ftype) - elif fid == 8: - if ftype == TType.STRING: - self.model = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 9: - if ftype == TType.STRING: - self.serial = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 10: - if ftype == TType.STRING: - self.rev = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_pwr_supply_info_t') - if self.vin is not None: - oprot.writeFieldBegin('vin', TType.I32, 1) - oprot.writeI32(self.vin) - oprot.writeFieldEnd() - if self.vout is not None: - oprot.writeFieldBegin('vout', TType.I32, 2) - oprot.writeI32(self.vout) - oprot.writeFieldEnd() - if self.iout is not None: - oprot.writeFieldBegin('iout', TType.I32, 3) - oprot.writeI32(self.iout) - oprot.writeFieldEnd() - if self.pwr_out is not None: - oprot.writeFieldBegin('pwr_out', TType.I32, 4) - oprot.writeI32(self.pwr_out) - oprot.writeFieldEnd() - if self.fspeed is not None: - oprot.writeFieldBegin('fspeed', TType.I32, 5) - oprot.writeI32(self.fspeed) - oprot.writeFieldEnd() - if self.ffault is not None: - oprot.writeFieldBegin('ffault', TType.BOOL, 6) - oprot.writeBool(self.ffault) - oprot.writeFieldEnd() - if self.load_sharing is not None: - oprot.writeFieldBegin('load_sharing', TType.BOOL, 7) - oprot.writeBool(self.load_sharing) - oprot.writeFieldEnd() - if self.model is not None: - oprot.writeFieldBegin('model', TType.STRING, 8) - oprot.writeString(self.model.encode('utf-8') if sys.version_info[0] == 2 else self.model) - oprot.writeFieldEnd() - if self.serial is not None: - oprot.writeFieldBegin('serial', TType.STRING, 9) - oprot.writeString(self.serial.encode('utf-8') if sys.version_info[0] == 2 else self.serial) - oprot.writeFieldEnd() - if self.rev is not None: - oprot.writeFieldBegin('rev', TType.STRING, 10) - oprot.writeString(self.rev.encode('utf-8') if sys.version_info[0] == 2 else self.rev) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_pwr_rail_info_t(object): - """ - Attributes: - - vrail1 - - vrail2 - - vrail3 - - vrail4 - - vrail5 - - vrail6 - - vrail7 - - vrail8 - - vrail9 - - vrail10 - - vrail11 - - vrail12 - - vrail13 - - vrail14 - - vrail15 - - vrail16 - """ - - thrift_spec = ( - None, # 0 - (1, TType.I32, 'vrail1', None, None, ), # 1 - (2, TType.I32, 'vrail2', None, None, ), # 2 - (3, TType.I32, 'vrail3', None, None, ), # 3 - (4, TType.I32, 'vrail4', None, None, ), # 4 - (5, TType.I32, 'vrail5', None, None, ), # 5 - (6, TType.I32, 'vrail6', None, None, ), # 6 - (7, TType.I32, 'vrail7', None, None, ), # 7 - (8, TType.I32, 'vrail8', None, None, ), # 8 - (9, TType.I32, 'vrail9', None, None, ), # 9 - (10, TType.I32, 'vrail10', None, None, ), # 10 - (11, TType.I32, 'vrail11', None, None, ), # 11 - (12, TType.I32, 'vrail12', None, None, ), # 12 - (13, TType.I32, 'vrail13', None, None, ), # 13 - (14, TType.I32, 'vrail14', None, None, ), # 14 - (15, TType.I32, 'vrail15', None, None, ), # 15 - (16, TType.I32, 'vrail16', None, None, ), # 16 - ) - - def __init__(self, vrail1=None, vrail2=None, vrail3=None, vrail4=None, vrail5=None, vrail6=None, vrail7=None, vrail8=None, vrail9=None, vrail10=None, vrail11=None, vrail12=None, vrail13=None, vrail14=None, vrail15=None, vrail16=None,): - self.vrail1 = vrail1 - self.vrail2 = vrail2 - self.vrail3 = vrail3 - self.vrail4 = vrail4 - self.vrail5 = vrail5 - self.vrail6 = vrail6 - self.vrail7 = vrail7 - self.vrail8 = vrail8 - self.vrail9 = vrail9 - self.vrail10 = vrail10 - self.vrail11 = vrail11 - self.vrail12 = vrail12 - self.vrail13 = vrail13 - self.vrail14 = vrail14 - self.vrail15 = vrail15 - self.vrail16 = vrail16 - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.I32: - self.vrail1 = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.I32: - self.vrail2 = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.I32: - self.vrail3 = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.I32: - self.vrail4 = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.I32: - self.vrail5 = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 6: - if ftype == TType.I32: - self.vrail6 = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 7: - if ftype == TType.I32: - self.vrail7 = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 8: - if ftype == TType.I32: - self.vrail8 = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 9: - if ftype == TType.I32: - self.vrail9 = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 10: - if ftype == TType.I32: - self.vrail10 = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 11: - if ftype == TType.I32: - self.vrail11 = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 12: - if ftype == TType.I32: - self.vrail12 = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 13: - if ftype == TType.I32: - self.vrail13 = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 14: - if ftype == TType.I32: - self.vrail14 = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 15: - if ftype == TType.I32: - self.vrail15 = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 16: - if ftype == TType.I32: - self.vrail16 = iprot.readI32() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_pwr_rail_info_t') - if self.vrail1 is not None: - oprot.writeFieldBegin('vrail1', TType.I32, 1) - oprot.writeI32(self.vrail1) - oprot.writeFieldEnd() - if self.vrail2 is not None: - oprot.writeFieldBegin('vrail2', TType.I32, 2) - oprot.writeI32(self.vrail2) - oprot.writeFieldEnd() - if self.vrail3 is not None: - oprot.writeFieldBegin('vrail3', TType.I32, 3) - oprot.writeI32(self.vrail3) - oprot.writeFieldEnd() - if self.vrail4 is not None: - oprot.writeFieldBegin('vrail4', TType.I32, 4) - oprot.writeI32(self.vrail4) - oprot.writeFieldEnd() - if self.vrail5 is not None: - oprot.writeFieldBegin('vrail5', TType.I32, 5) - oprot.writeI32(self.vrail5) - oprot.writeFieldEnd() - if self.vrail6 is not None: - oprot.writeFieldBegin('vrail6', TType.I32, 6) - oprot.writeI32(self.vrail6) - oprot.writeFieldEnd() - if self.vrail7 is not None: - oprot.writeFieldBegin('vrail7', TType.I32, 7) - oprot.writeI32(self.vrail7) - oprot.writeFieldEnd() - if self.vrail8 is not None: - oprot.writeFieldBegin('vrail8', TType.I32, 8) - oprot.writeI32(self.vrail8) - oprot.writeFieldEnd() - if self.vrail9 is not None: - oprot.writeFieldBegin('vrail9', TType.I32, 9) - oprot.writeI32(self.vrail9) - oprot.writeFieldEnd() - if self.vrail10 is not None: - oprot.writeFieldBegin('vrail10', TType.I32, 10) - oprot.writeI32(self.vrail10) - oprot.writeFieldEnd() - if self.vrail11 is not None: - oprot.writeFieldBegin('vrail11', TType.I32, 11) - oprot.writeI32(self.vrail11) - oprot.writeFieldEnd() - if self.vrail12 is not None: - oprot.writeFieldBegin('vrail12', TType.I32, 12) - oprot.writeI32(self.vrail12) - oprot.writeFieldEnd() - if self.vrail13 is not None: - oprot.writeFieldBegin('vrail13', TType.I32, 13) - oprot.writeI32(self.vrail13) - oprot.writeFieldEnd() - if self.vrail14 is not None: - oprot.writeFieldBegin('vrail14', TType.I32, 14) - oprot.writeI32(self.vrail14) - oprot.writeFieldEnd() - if self.vrail15 is not None: - oprot.writeFieldBegin('vrail15', TType.I32, 15) - oprot.writeI32(self.vrail15) - oprot.writeFieldEnd() - if self.vrail16 is not None: - oprot.writeFieldBegin('vrail16', TType.I32, 16) - oprot.writeI32(self.vrail16) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class pltfm_mgr_fan_info_t(object): - """ - Attributes: - - fan_num - - front_rpm - - rear_rpm - - percent - """ - - thrift_spec = ( - None, # 0 - (1, TType.I32, 'fan_num', None, None, ), # 1 - (2, TType.I32, 'front_rpm', None, None, ), # 2 - (3, TType.I32, 'rear_rpm', None, None, ), # 3 - (4, TType.I32, 'percent', None, None, ), # 4 - ) - - def __init__(self, fan_num=None, front_rpm=None, rear_rpm=None, percent=None,): - self.fan_num = fan_num - self.front_rpm = front_rpm - self.rear_rpm = rear_rpm - self.percent = percent - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.I32: - self.fan_num = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.I32: - self.front_rpm = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.I32: - self.rear_rpm = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.I32: - self.percent = iprot.readI32() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('pltfm_mgr_fan_info_t') - if self.fan_num is not None: - oprot.writeFieldBegin('fan_num', TType.I32, 1) - oprot.writeI32(self.fan_num) - oprot.writeFieldEnd() - if self.front_rpm is not None: - oprot.writeFieldBegin('front_rpm', TType.I32, 2) - oprot.writeI32(self.front_rpm) - oprot.writeFieldEnd() - if self.rear_rpm is not None: - oprot.writeFieldBegin('rear_rpm', TType.I32, 3) - oprot.writeI32(self.rear_rpm) - oprot.writeFieldEnd() - if self.percent is not None: - oprot.writeFieldBegin('percent', TType.I32, 4) - oprot.writeI32(self.percent) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - - -class InvalidPltfmMgrOperation(TException): - """ - Attributes: - - code - """ - - thrift_spec = ( - None, # 0 - (1, TType.I32, 'code', None, None, ), # 1 - ) - - def __init__(self, code=None,): - self.code = code - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.I32: - self.code = iprot.readI32() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('InvalidPltfmMgrOperation') - if self.code is not None: - oprot.writeFieldBegin('code', TType.I32, 1) - oprot.writeI32(self.code) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __str__(self): - return repr(self) - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in list(self.__dict__.items())] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/psuutil.py b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/psuutil.py deleted file mode 100644 index 0ef5162d28..0000000000 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/psuutil.py +++ /dev/null @@ -1,96 +0,0 @@ -try: - import os - import sys - import importlib - - sys.path.append(os.path.dirname(__file__)) - import pltfm_mgr_rpc - from pltfm_mgr_rpc.ttypes import * - - from thrift.transport import TSocket - from thrift.transport import TTransport - from thrift.protocol import TBinaryProtocol - from thrift.protocol import TMultiplexedProtocol - - from sonic_psu.psu_base import PsuBase -except ImportError as e: - raise ImportError(str(e) + "- required module not found") - -thrift_server = 'localhost' -transport = None -pltfm_mgr = None - - -class PsuUtil(PsuBase): - """Platform-specific PSUutil class""" - - def __init__(self): - PsuBase.__init__(self) - - def thrift_setup(self): - global thrift_server, transport, pltfm_mgr - transport = TSocket.TSocket(thrift_server, 9090) - - transport = TTransport.TBufferedTransport(transport) - bprotocol = TBinaryProtocol.TBinaryProtocol(transport) - - pltfm_mgr_client_module = importlib.import_module( - ".".join(["pltfm_mgr_rpc", "pltfm_mgr_rpc"])) - pltfm_mgr_protocol = TMultiplexedProtocol.TMultiplexedProtocol( - bprotocol, "pltfm_mgr_rpc") - pltfm_mgr = pltfm_mgr_client_module.Client(pltfm_mgr_protocol) - - transport.open() - - def thrift_teardown(self): - global transport - transport.close() - - def get_num_psus(self): - """ - Retrieves the number of PSUs available on the device - :return: An integer, the number of PSUs available on the device - """ - return 2 - - def get_psu_status(self, index): - """ - Retrieves the oprational status of power supply unit (PSU) defined - by 1-based index - :param index: An integer, 1-based index of the PSU of which to query status - :return: Boolean, True if PSU is operating properly, False if PSU is faulty - """ - if index is None: - return False - - global pltfm_mgr - - try: - self.thrift_setup() - psu_info = pltfm_mgr.pltfm_mgr_pwr_supply_info_get(index) - self.thrift_teardown() - except: - return False - - return (psu_info.ffault == False) - - def get_psu_presence(self, index): - """ - Retrieves the presence status of power supply unit (PSU) defined - by 1-based index - :param index: An integer, 1-based index of the PSU of which to query status - :return: Boolean, True if PSU is plugged, False if not - """ - if index is None: - return False - - global pltfm_mgr - - try: - self.thrift_setup() - status = pltfm_mgr.pltfm_mgr_pwr_supply_present_get(index) - self.thrift_teardown() - except: - return False - - return status diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/sfputil.py b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/sfputil.py deleted file mode 100644 index 41d75501f4..0000000000 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/sfputil.py +++ /dev/null @@ -1,250 +0,0 @@ -try: - import os - import sys - import importlib - import time - - sys.path.append(os.path.dirname(__file__)) - import pltfm_mgr_rpc - from pltfm_mgr_rpc.ttypes import * - - from thrift.transport import TSocket - from thrift.transport import TTransport - from thrift.protocol import TBinaryProtocol - from thrift.protocol import TMultiplexedProtocol - - from sonic_sfp.sfputilbase import SfpUtilBase -except ImportError as e: - raise ImportError(str(e) + "- required module not found") - -thrift_server = 'localhost' -transport = None -pltfm_mgr = None - -SFP_EEPROM_CACHE = "/var/run/platform/sfp/cache" - - -class SfpUtil(SfpUtilBase): - """Platform-specific SfpUtil class""" - - PORT_START = 1 - PORT_END = 0 - PORTS_IN_BLOCK = 0 - QSFP_PORT_START = 1 - QSFP_PORT_END = 0 - EEPROM_OFFSET = 0 - QSFP_CHECK_INTERVAL = 4 - THRIFT_RETRIES = 5 - THRIFT_TIMEOUT = 5 - - @property - def port_start(self): - self.update_port_info() - return self.PORT_START - - @property - def port_end(self): - self.update_port_info() - return self.PORT_END - - @property - def qsfp_ports(self): - self.update_port_info() - return list(range(self.QSFP_PORT_START, self.PORTS_IN_BLOCK + 1)) - - @property - def port_to_eeprom_mapping(self): - print("dependency on sysfs has been removed") - raise Exception() - - def __init__(self): - self.ready = False - self.phy_port_dict = {'-1': 'system_not_ready'} - self.phy_port_cur_state = {} - self.qsfp_interval = self.QSFP_CHECK_INTERVAL - - if not os.path.exists(os.path.dirname(SFP_EEPROM_CACHE)): - try: - os.makedirs(os.path.dirname(SFP_EEPROM_CACHE)) - except OSError as e: - if e.errno != errno.EEXIST: - raise - - open(SFP_EEPROM_CACHE, 'ab').close() - - SfpUtilBase.__init__(self) - - def update_port_info(self): - global pltfm_mgr - - if self.QSFP_PORT_END == 0: - self.thrift_setup() - self.QSFP_PORT_END = pltfm_mgr.pltfm_mgr_qsfp_get_max_port() - self.PORT_END = self.QSFP_PORT_END - self.PORTS_IN_BLOCK = self.QSFP_PORT_END - self.thrift_teardown() - - def thrift_setup(self): - global thrift_server, transport, pltfm_mgr - transport = TSocket.TSocket(thrift_server, 9090) - - transport = TTransport.TBufferedTransport(transport) - bprotocol = TBinaryProtocol.TBinaryProtocol(transport) - - pltfm_mgr_client_module = importlib.import_module(".".join(["pltfm_mgr_rpc", "pltfm_mgr_rpc"])) - pltfm_mgr_protocol = TMultiplexedProtocol.TMultiplexedProtocol(bprotocol, "pltfm_mgr_rpc") - pltfm_mgr = pltfm_mgr_client_module.Client(pltfm_mgr_protocol) - - for i in range(self.THRIFT_RETRIES): - try: - transport.open() - if i: - # The main thrift server is starded without platform api - # Platform api is added later during syncd initialization - # So we need to wait a little bit before do any platform api call - # Just in case when can't connect from the first try (warm-reboot case) - time.sleep(self.THRIFT_TIMEOUT) - break - except TTransport.TTransportException as e: - if e.type != TTransport.TTransportException.NOT_OPEN or i >= self.THRIFT_RETRIES - 1: - raise e - time.sleep(self.THRIFT_TIMEOUT) - - def thrift_teardown(self): - global transport - transport.close() - - def get_presence(self, port_num): - # Check for invalid port_num - if port_num < self.port_start or port_num > self.port_end: - return False - - presence = False - - try: - self.thrift_setup() - presence = pltfm_mgr.pltfm_mgr_qsfp_presence_get(port_num) - self.thrift_teardown() - except Exception as e: - print(e.__doc__) - print(e.message) - - return presence - - def get_low_power_mode(self, port_num): - # Check for invalid port_num - if port_num < self.port_start or port_num > self.port_end: - return False - - self.thrift_setup() - lpmode = pltfm_mgr.pltfm_mgr_qsfp_lpmode_get(port_num) - self.thrift_teardown() - return lpmode - - def set_low_power_mode(self, port_num, lpmode): - # Check for invalid port_num - if port_num < self.port_start or port_num > self.port_end: - return False - - self.thrift_setup() - status = pltfm_mgr.pltfm_mgr_qsfp_lpmode_set(port_num, lpmode) - self.thrift_teardown() - return (status == 0) - - def reset(self, port_num): - # Check for invalid port_num - if port_num < self.port_start or port_num > self.port_end: - return False - - self.thrift_setup() - status = pltfm_mgr.pltfm_mgr_qsfp_reset(port_num, True) - status = pltfm_mgr.pltfm_mgr_qsfp_reset(port_num, False) - self.thrift_teardown() - return (status == 0) - - def check_transceiver_change(self): - if not self.ready: - return - - self.phy_port_dict = {} - - try: - self.thrift_setup() - except: - return - - # Get presence of each SFP - for port in range(self.port_start, self.port_end + 1): - try: - sfp_resent = pltfm_mgr.pltfm_mgr_qsfp_presence_get(port) - except: - sfp_resent = False - sfp_state = '1' if sfp_resent else '0' - - if port in self.phy_port_cur_state: - if self.phy_port_cur_state[port] != sfp_state: - self.phy_port_dict[port] = sfp_state - else: - self.phy_port_dict[port] = sfp_state - - # Update port current state - self.phy_port_cur_state[port] = sfp_state - - self.thrift_teardown() - - def get_transceiver_change_event(self, timeout=0): - forever = False - if timeout == 0: - forever = True - elif timeout > 0: - timeout = timeout / float(1000) # Convert to secs - else: - print("get_transceiver_change_event:Invalid timeout value", timeout) - return False, {} - - while forever or timeout > 0: - if not self.ready: - try: - self.thrift_setup() - self.thrift_teardown() - except: - pass - else: - self.ready = True - self.phy_port_dict = {} - break - elif self.qsfp_interval == 0: - self.qsfp_interval = self.QSFP_CHECK_INTERVAL - - # Process transceiver plug-in/out event - self.check_transceiver_change() - - # Break if tranceiver state has changed - if bool(self.phy_port_dict): - break - - if timeout: - timeout -= 1 - - if self.qsfp_interval: - self.qsfp_interval -= 1 - - time.sleep(1) - - return self.ready, self.phy_port_dict - - def _get_port_eeprom_path(self, port_num, devid): - eeprom_path = None - - self.thrift_setup() - presence = pltfm_mgr.pltfm_mgr_qsfp_presence_get(port_num) - if presence == True: - eeprom_cache = open(SFP_EEPROM_CACHE, 'wb') - eeprom_hex = pltfm_mgr.pltfm_mgr_qsfp_info_get(port_num) - eeprom_raw = bytearray.fromhex(eeprom_hex) - eeprom_cache.write(eeprom_raw) - eeprom_cache.close() - eeprom_path = SFP_EEPROM_CACHE - self.thrift_teardown() - - return eeprom_path diff --git a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/plugins b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/plugins deleted file mode 120000 index a8464d1ec2..0000000000 --- a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/plugins +++ /dev/null @@ -1 +0,0 @@ -../x86_64-accton_wedge100bf_32x-r0/plugins/ \ No newline at end of file