Skip to content

Commit

Permalink
correct the variable type of the psu_id for pdu_ports finding.
Browse files Browse the repository at this point in the history
  • Loading branch information
sujinmkang committed Apr 6, 2020
1 parent 0d1f212 commit c4abfec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/common/plugins/psu_controller/snmp_psu_controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
from controller_base import PsuControllerBase
from controller_base import run_local_cmd


try:
from pysnmp.proto import rfc1902
from pysnmp.entity.rfc3413.oneliner import cmdgen
from pyasn1.type import univ
except:
logging.error("Missing required pysnmp module (check docs)")

class snmpPsuController(PsuControllerBase):
"""
PSU Controller class for SNMP conrolled PSUs - 'Sentry Switched CDU' and 'APC Web/SNMP Management Card'
Expand Down Expand Up @@ -142,7 +142,7 @@ def turn_on_psu(self, psu_id):
@param psu_id: ID of the PSU on SONiC DUT
@return: Return true if successfully execute the command for turning on power. Otherwise return False.
"""
port_oid = self.pPORT_CONTROL_BASE_OID + self.pdu_ports[psu_id]
port_oid = self.pPORT_CONTROL_BASE_OID + self.pdu_ports[rfc1902.Integer(psu_id)]
errorIndication, errorStatus, _, _ = \
cmdgen.CommandGenerator().setCmd(
cmdgen.CommunityData('private'),
Expand Down Expand Up @@ -171,7 +171,7 @@ def turn_off_psu(self, psu_id):
@param psu_id: ID of the PSU on SONiC DUT
@return: Return true if successfully execute the command for turning off power. Otherwise return False.
"""
port_oid = self.pPORT_CONTROL_BASE_OID + self.pdu_ports[psu_id]
port_oid = self.pPORT_CONTROL_BASE_OID + self.pdu_ports[rfc1902.Integer(psu_id)]
errorIndication, errorStatus, _, _ = \
cmdgen.CommandGenerator().setCmd(
cmdgen.CommunityData('private'),
Expand Down

0 comments on commit c4abfec

Please sign in to comment.