summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelie <elie>2014-06-09 13:07:07 +0000
committerelie <elie>2014-06-09 13:07:07 +0000
commit8ccf35c5251291ca5829a038f1cd2a071847408b (patch)
tree80b258d3467c91a5b6518c9c22e01962197e92c4
parenta838cc3abb71d896631ff1d98707448f8374956d (diff)
downloadpysnmp-8ccf35c5251291ca5829a038f1cd2a071847408b.tar.gz
sendNotification() API correction
-rw-r--r--examples/v3arch/oneliner/agent/ntforg/inform-async-multiple-snmp-engines.py4
-rw-r--r--examples/v3arch/oneliner/agent/ntforg/inform-async-multiple-transports-and-protocols.py4
-rw-r--r--examples/v3arch/oneliner/agent/ntforg/trap-async-multiple-transports-and-protocols.py4
-rw-r--r--pysnmp/entity/rfc3413/ntforg.py4
-rw-r--r--pysnmp/entity/rfc3413/oneliner/ntforg.py13
5 files changed, 15 insertions, 14 deletions
diff --git a/examples/v3arch/oneliner/agent/ntforg/inform-async-multiple-snmp-engines.py b/examples/v3arch/oneliner/agent/ntforg/inform-async-multiple-snmp-engines.py
index bf04e67..088b72b 100644
--- a/examples/v3arch/oneliner/agent/ntforg/inform-async-multiple-snmp-engines.py
+++ b/examples/v3arch/oneliner/agent/ntforg/inform-async-multiple-snmp-engines.py
@@ -74,10 +74,10 @@ for authData, transportTarget in targets:
snmpEngineA or snmpEngineB
sendPduHandle = ntfOrg.sendNotification(
snmpEngine,
- context.SnmpContext(snmpEngine),
authData,
transportTarget,
- ntforg.ContextData(),
+ context.SnmpContext(snmpEngine),
+ ntforg.null,
'inform',
ntforg.MibVariable('SNMPv2-MIB', 'coldStart'),
( ( rfc1902.ObjectName('1.3.6.1.2.1.1.1.0'),
diff --git a/examples/v3arch/oneliner/agent/ntforg/inform-async-multiple-transports-and-protocols.py b/examples/v3arch/oneliner/agent/ntforg/inform-async-multiple-transports-and-protocols.py
index 7d9b497..a19bc11 100644
--- a/examples/v3arch/oneliner/agent/ntforg/inform-async-multiple-transports-and-protocols.py
+++ b/examples/v3arch/oneliner/agent/ntforg/inform-async-multiple-transports-and-protocols.py
@@ -46,10 +46,10 @@ ntfOrg = ntforg.AsyncNotificationOriginator()
for authData, transportTarget in targets:
sendPduHandle = ntfOrg.sendNotification(
snmpEngine,
- context.SnmpContext(snmpEngine),
authData,
transportTarget,
- cmdgen.ContextData(),
+ context.SnmpContext(snmpEngine),
+ ntforg.null,
'inform',
ntforg.MibVariable('SNMPv2-MIB', 'coldStart'),
( ( rfc1902.ObjectName('1.3.6.1.2.1.1.1.0'),
diff --git a/examples/v3arch/oneliner/agent/ntforg/trap-async-multiple-transports-and-protocols.py b/examples/v3arch/oneliner/agent/ntforg/trap-async-multiple-transports-and-protocols.py
index 1fdee69..a075fda 100644
--- a/examples/v3arch/oneliner/agent/ntforg/trap-async-multiple-transports-and-protocols.py
+++ b/examples/v3arch/oneliner/agent/ntforg/trap-async-multiple-transports-and-protocols.py
@@ -34,10 +34,10 @@ ntfOrg = ntforg.AsyncNotificationOriginator()
for authData, transportTarget in targets:
ntfOrg.sendNotification(
snmpEngine,
- context.SnmpContext(snmpEngine),
authData,
transportTarget,
- ntforg.ContextData(),
+ context.SnmpContext(snmpEngine),
+ ntforg.null,
'trap',
ntforg.MibVariable('SNMPv2-MIB', 'coldStart'),
( ( rfc1902.ObjectName('1.3.6.1.2.1.1.1.0'),
diff --git a/pysnmp/entity/rfc3413/ntforg.py b/pysnmp/entity/rfc3413/ntforg.py
index 422c2cf..6ab232b 100644
--- a/pysnmp/entity/rfc3413/ntforg.py
+++ b/pysnmp/entity/rfc3413/ntforg.py
@@ -253,9 +253,9 @@ class NotificationOriginator:
def sendVarBinds(self,
snmpEngine,
+ notificationTarget,
snmpContext,
contextName,
- notificationTarget,
notificationName,
instanceIndex,
additionalVarBinds=(),
@@ -439,9 +439,9 @@ def _sendNotification(self,
cbFun = _sendNotificationCbFun
return self.sendVarBinds(snmpEngine,
+ notificationTarget,
self.snmpContext,
contextName,
- notificationTarget,
notificationName,
instanceIndex,
additionalVarBinds,
diff --git a/pysnmp/entity/rfc3413/oneliner/ntforg.py b/pysnmp/entity/rfc3413/oneliner/ntforg.py
index b65f2e1..357d150 100644
--- a/pysnmp/entity/rfc3413/oneliner/ntforg.py
+++ b/pysnmp/entity/rfc3413/oneliner/ntforg.py
@@ -6,7 +6,6 @@ from pysnmp.entity.rfc3413.oneliner.mibvar import MibVariable
from pysnmp.entity.rfc3413.oneliner.auth import CommunityData, UsmUserData
from pysnmp.entity.rfc3413.oneliner.target import UdpTransportTarget, \
Udp6TransportTarget, UnixTransportTarget
-from pysnmp.entity.rfc3413.oneliner.ctx import ContextData
from pysnmp.entity.rfc3413.oneliner import cmdgen
# Auth protocol
@@ -113,8 +112,9 @@ class AsyncNotificationOriginator(cmdgen.AsyncCommandGenerator):
)
del cache['auth'][authDataKey]
- def sendNotification(self, snmpEngine, snmpContext,
- authData, transportTarget, contextData,
+ def sendNotification(self, snmpEngine,
+ authData, transportTarget,
+ snmpContext, contextName,
notifyType,
notificationType, instanceIndex,
varBinds=(),
@@ -155,7 +155,7 @@ class AsyncNotificationOriginator(cmdgen.AsyncCommandGenerator):
cache['mibViewController'], oidOnly=True
)
- return ntforg.NotificationOriginator().sendVarBinds(snmpEngine, snmpContext, contextData.contextName, notifyName, notificationType, instanceIndex, self.makeVarBinds(snmpEngine, varBinds), __cbFun, (lookupNames, lookupValues, cbFun, cbCtx))
+ return ntforg.NotificationOriginator().sendVarBinds(snmpEngine, notifyName, snmpContext, contextName, notificationType, instanceIndex, self.makeVarBinds(snmpEngine, varBinds), __cbFun, (lookupNames, lookupValues, cbFun, cbCtx))
# substitute sendNotification return object for backward compatibility
class ErrorIndicationReturn:
@@ -230,8 +230,9 @@ class AsynNotificationOriginator(cmdgen.AsynCommandGenerator):
notificationType = MibVariable(notificationType[0][0], notificationType[0][1], *notificationType[1:]).resolveWithMib(self.mibViewController)
return self.__asyncNtfOrg.sendNotification(
- self.snmpEngine, self.snmpContext,
- authData, transportTarget, ContextData(contextName=contextName),
+ self.snmpEngine,
+ authData, transportTarget,
+ self.snmpContext, contextName,
notifyType, notificationType, None, varBinds,
(__cbFun, cbInfo),
lookupNames, lookupValues