Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix LGTM Issues #37

Merged
merged 2 commits into from
Feb 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions device/delta/arm64-delta_tg48m_poe-r0/plugins/led_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
#
try:
from sonic_led.led_control_base import LedControlBase
import swsssdk
import threading
import os
import logging
import struct
import time
from socket import *
from select import *
Expand Down
2 changes: 0 additions & 2 deletions device/delta/arm64-delta_tg48m_poe-r0/plugins/psuutil.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python

import sys
import os.path
if sys.version_info[0] < 3:
import commands as cmd
else:
Expand All @@ -23,7 +22,6 @@ class PsuUtil(PsuBase):

def __init__(self):
PsuBase.__init__(self)
MAX_PSUS = 2

def get_num_psus(self):
MAX_PSUS = 2
Expand Down
10 changes: 3 additions & 7 deletions device/delta/arm64-delta_tg48m_poe-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,17 @@ def get_presence(self, port_num):
if port_num < self._port_start or port_num > self._port_end:
return False
prt = port_num % 49
sel = "{0:02b}".format(prt)
p = sel[0]
q = sel[1]
#sel = "{0:02b}".format(prt)

pos = [1,2,4,8]
bit_pos = pos[prt]
if smbus_present == 0:
cmdstatus, sfpstatus = cmd.getstatusoutput('i2cget -y 2 0x41 0x3') #need to verify the cpld register logic
cmdstatus, sfpstatus = cmd.getstatusoutput('i2cget -y 2 0x41 0x3A') #need to verify the cpld register logic
sfpstatus = int(sfpstatus, 16)
else :
bus = smbus.SMBus(2)
DEVICE_ADDRESS = 0x41
DEVICE_REG = 0x3
DEVICE_REG = 0x3A
sfpstatus = bus.read_byte_data(DEVICE_ADDRESS, DEVICE_REG)
sfpstatus = sfpstatus&(bit_pos)
if sfpstatus == 0:
Expand Down Expand Up @@ -232,7 +230,6 @@ def port_to_eeprom_mapping(self):

def get_transceiver_change_event(self, timeout):
port_dict = {}
port = 0

if timeout == 0:
cd_ms = sys.maxint
Expand Down Expand Up @@ -264,7 +261,6 @@ def get_transceiver_change_event(self, timeout):
return True, port_dict
else:
return True, {}
return False, {}