Note that there are some explanatory texts on larger screens.

plurals
  1. POpySnmp async reacts differently from sync
    primarykey
    data
    text
    <p>I have 2 almost identical method calls and they return different results</p> <pre><code>from pyasn1.type import univ from pysnmp.entity.rfc3413.oneliner import cmdgen def printResult(*result): print str(result) print cmdgen.CommandGenerator().nextCmd(cmdgen.CommunityData('agent', 'public', 1), cmdgen.UdpTransportTarget(('172.16.1.15', 161)), (univ.ObjectIdentifier(("1.3.6.1.4.1.5528.100.4.1.1.1.10"),))) getCmdGen = cmdgen.AsynCommandGenerator() getCmdGen.nextCmd(cmdgen.CommunityData('agent', 'public', 1), cmdgen.UdpTransportTarget(('172.16.1.15', 161)), (univ.ObjectIdentifier(("1.3.6.1.4.1.5528.100.4.1.1.1.10")),), (printResult, (None,))) getCmdGen.snmpEngine.transportDispatcher.runDispatcher() </code></pre> <p>This prints out:</p> <pre><code>(None, Integer('noError'), Integer(0), [[(ObjectName(1.3.6.1.4.1.5528.100.4.1.1.1.10.1095346743), Counter32(1095346743))], [(ObjectName(1.3.6.1.4.1.5528.100.4.1.1.1.10.1382714849), Counter32(1382714849))]]) (695125368, None, Integer('noError'), Integer(0), [[(ObjectName(1.3.6.1.4.1.5528.100.4.1.1.1.10.1095346743), Counter32(1095346743))]], None) </code></pre> <p>And if you look closely you'll see that the first one correctly returns 2 items and the second one only returns 1:</p> <pre><code>[[(ObjectName(1.3.6.1.4.1.5528.100.4.1.1.1.10.1095346743), Counter32(1095346743))], [(ObjectName(1.3.6.1.4.1.5528.100.4.1.1.1.10.1382714849), Counter32(1382714849))]] </code></pre> <p>vs</p> <pre><code>[[(ObjectName(1.3.6.1.4.1.5528.100.4.1.1.1.10.1095346743), Counter32(1095346743))]] </code></pre> <p>Edit. Found out why I got a weird error in some cases but that didn't fix the rest</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload