Skip to content

Commit e02c99c

Browse files
wangxinytzur1
authored andcommitted
Fix snmp_facts for creating IPv6 UdpTransportTarget (sonic-net#21272)
In PR sonic-net#21045, I made mistakes while resolving the conflicts with sonic-net#20292. Some code added in sonic-net#20292 was accidentally reverted. This change is to add back the code introduced in sonic-net#20292 for creating SNMP UdpTransportTarget. Then the snmp_facts module will work with IPv6 only scenario again. Signed-off-by: Xin Wang <[email protected]> Signed-off-by: Yael Tzur <[email protected]>
1 parent a2632d4 commit e02c99c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ansible/library/snmp_facts.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ def main_legacy(module):
952952

953953
errorIndication, errorStatus, errorIndex, varTable = cmdGen.nextCmd(
954954
snmp_auth,
955-
cmdgen.UdpTransportTarget((m_args['host'], 161), timeout=m_args['timeout']),
955+
_create_transport_target(m_args['host'], 161, m_args['timeout']),
956956
cmdgen.MibVariable(p.csqIfQosGroupStatsValue,),
957957
lookupMib=False,
958958
)
@@ -991,7 +991,7 @@ def main_legacy(module):
991991

992992
errorIndication, errorStatus, errorIndex, varTable = cmdGen.nextCmd(
993993
snmp_auth,
994-
cmdgen.UdpTransportTarget((m_args['host'], 161), timeout=m_args['timeout']),
994+
_create_transport_target(m_args['host'], 161, m_args['timeout']),
995995
cmdgen.MibVariable(p.ipCidrRouteDest,),
996996
cmdgen.MibVariable(p.ipCidrRouteStatus,),
997997
lookupMib=False,
@@ -1070,7 +1070,7 @@ def main_legacy(module):
10701070

10711071
errorIndication, errorStatus, errorIndex, varTable = cmdGen.nextCmd(
10721072
snmp_auth,
1073-
cmdgen.UdpTransportTarget((m_args['host'], 161), timeout=m_args['timeout']),
1073+
_create_transport_target(m_args['host'], 161, m_args['timeout']),
10741074
cmdgen.MibVariable(p.dot1qTpFdbPort,),
10751075
lookupMib=False,
10761076
)

0 commit comments

Comments
 (0)