summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelie <elie>2005-10-12 16:02:47 +0000
committerelie <elie>2005-10-12 16:02:47 +0000
commit6f0ab5837efab2b4c3cca1671c9aed5f793c957a (patch)
tree04339814dea2dbe38a032fc5fa04d88e4da62451
parent96661e8937078749ea1b2066dae4671309f2be31 (diff)
downloadpysnmp-6f0ab5837efab2b4c3cca1671c9aed5f793c957a.tar.gz
sendNotification() now takes notifyType parameter (trap or inform)
-rw-r--r--pysnmp/entity/rfc3413/oneliner/ntforg.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/pysnmp/entity/rfc3413/oneliner/ntforg.py b/pysnmp/entity/rfc3413/oneliner/ntforg.py
index 551f49c..a99d439 100644
--- a/pysnmp/entity/rfc3413/oneliner/ntforg.py
+++ b/pysnmp/entity/rfc3413/oneliner/ntforg.py
@@ -1,5 +1,5 @@
from pysnmp.entity import config
-from pysnmp.entity.rfc3413 import ntforg, context
+from pysnmp.entity.rfc3413 import ntforg, context, mibvar
from pysnmp.entity.rfc3413.oneliner import cmdgen
# Auth protocol
@@ -25,7 +25,8 @@ class AsynNotificationOriginator(cmdgen.AsynCommandGenerator):
self.__knownAuths = {}
def asyncSendNotification(
- self, authData, transportTarget, notificationType, varBinds=None
+ self, authData, transportTarget, notifyType,
+ notificationType, varBinds=None
):
tagList = 'notify-list'
addrName, paramsName = cmdgen.AsynCommandGenerator._configure(
@@ -38,7 +39,8 @@ class AsynNotificationOriginator(cmdgen.AsynCommandGenerator):
self.snmpEngine,
notifyName,
paramsName,
- tagList
+ tagList,
+ notifyType
)
config.addContext(
self.snmpEngine, ''
@@ -63,17 +65,18 @@ class AsynNotificationOriginator(cmdgen.AsynCommandGenerator):
__varBinds.append((name + oid, varVal))
else:
__varBinds = None
-
- return ntforg.NotificationOriginator(snmpContext).sendNotification(
+
+ return ntforg.NotificationOriginator(self.snmpContext).sendNotification(
self.snmpEngine, notifyName, notificationType, __varBinds
)
class NotificationOriginator(AsynNotificationOriginator):
def sendNotification(
- self, authData, transportTarget, notificationType, varBinds=None
+ self, authData, transportTarget, notifyType,
+ notificationType, varBinds=None
):
errorIndication = self.asyncSendNotification(
- authData, transportTarget, notificationType, varBinds
+ authData, transportTarget, notifyType, notificationType, varBinds
)
if errorIndication:
return errorIndication