summaryrefslogtreecommitdiff
path: root/pysnmp/entity
diff options
context:
space:
mode:
authorelie <elie>2014-06-17 15:19:53 +0000
committerelie <elie>2014-06-17 15:19:53 +0000
commitd703289a12f1d6cdf15af88fcfe2d43ef8012bd9 (patch)
tree7278b1f6a5ad3f4d6ade56c8c6ecd56d1461298d /pysnmp/entity
parentdad702f69446abcbcf32584743beb47f4583e0cd (diff)
downloadpysnmp-d703289a12f1d6cdf15af88fcfe2d43ef8012bd9.tar.gz
pylint'ed
Diffstat (limited to 'pysnmp/entity')
-rw-r--r--pysnmp/entity/observer.py3
-rw-r--r--pysnmp/entity/rfc3413/cmdgen.py2
-rw-r--r--pysnmp/entity/rfc3413/ntforg.py28
-rw-r--r--pysnmp/entity/rfc3413/twisted/cmdgen.py7
-rw-r--r--pysnmp/entity/rfc3413/twisted/ntforg.py4
5 files changed, 21 insertions, 23 deletions
diff --git a/pysnmp/entity/observer.py b/pysnmp/entity/observer.py
index 153817c..f04d611 100644
--- a/pysnmp/entity/observer.py
+++ b/pysnmp/entity/observer.py
@@ -13,6 +13,7 @@
# to exist to functions that are at the same or deeper level of invocation
# relative to execution point specified.
#
+from pysnmp import error
class MetaObserver:
def __init__(self):
@@ -52,7 +53,7 @@ class MetaObserver:
for execpoint in execpoints:
del self.__execpoints[execpoint]
else:
- self._execpoints.clear()
+ self.__execpoints.clear()
def getExecutionContext(self, execpoint):
return self.__execpoints[execpoint]
diff --git a/pysnmp/entity/rfc3413/cmdgen.py b/pysnmp/entity/rfc3413/cmdgen.py
index ec639f7..2ef85f2 100644
--- a/pysnmp/entity/rfc3413/cmdgen.py
+++ b/pysnmp/entity/rfc3413/cmdgen.py
@@ -254,7 +254,7 @@ class CommandGenerator:
0
)
- debug.logger & debug.flagApp and debug.logger('sendPdu: sendPduHandle %s, timeout %d*10 ms/%d ticks, retry %d of %d' % (sendPduHandle, timeout, timeoutInTicks, retries, retryCount))
+ debug.logger & debug.flagApp and debug.logger('sendPdu: sendPduHandle %s, timeout %d*10 ms/%d ticks, retry 0 of %d' % (sendPduHandle, timeout, timeoutInTicks, retryCount))
return sendRequestHandle
diff --git a/pysnmp/entity/rfc3413/ntforg.py b/pysnmp/entity/rfc3413/ntforg.py
index afa3807..98e92c8 100644
--- a/pysnmp/entity/rfc3413/ntforg.py
+++ b/pysnmp/entity/rfc3413/ntforg.py
@@ -242,14 +242,14 @@ class NotificationOriginator:
errorIndication,
pdu,
cbCtx):
- cbFun, cbCtx = cbCtx
- cbFun(snmpEngine,
- sendRequestHandle,
- errorIndication,
- pdu and v2c.apiPDU.getErrorStatus(pdu) or 0,
- pdu and v2c.apiPDU.getErrorIndex(pdu, muteErrors=True) or 0,
- pdu and v2c.apiPDU.getVarBinds(pdu) or (),
- cbCtx)
+ cbFun, cbCtx = cbCtx
+ cbFun(snmpEngine,
+ sendRequestHandle,
+ errorIndication,
+ pdu and v2c.apiPDU.getErrorStatus(pdu) or 0,
+ pdu and v2c.apiPDU.getErrorIndex(pdu, muteErrors=True) or 0,
+ pdu and v2c.apiPDU.getVarBinds(pdu) or (),
+ cbCtx)
def sendVarBinds(self,
snmpEngine,
@@ -381,13 +381,11 @@ class NotificationOriginator:
not self.__pendingNotifications[sendRequestHandle]:
if sendRequestHandle in self.__pendingNotifications:
del self.__pendingNotifications[sendRequestHandle]
- self._handleResponse(
- sendRequestHandle,
- statusInformation['errorIndication'],
- 0, 0, (),
- cbFun,
- cbCtx
- )
+ cbFun(snmpEngine,
+ sendRequestHandle,
+ statusInformation['errorIndication'],
+ None,
+ cbCtx)
return sendRequestHandle
debug.logger & debug.flagApp and debug.logger('sendVarBinds: sendRequestHandle %s, timeout %d' % (sendRequestHandle, timeout))
diff --git a/pysnmp/entity/rfc3413/twisted/cmdgen.py b/pysnmp/entity/rfc3413/twisted/cmdgen.py
index d57a824..71f6c50 100644
--- a/pysnmp/entity/rfc3413/twisted/cmdgen.py
+++ b/pysnmp/entity/rfc3413/twisted/cmdgen.py
@@ -1,8 +1,7 @@
from twisted.internet import defer
from pysnmp.entity.rfc3413 import cmdgen
-from pyasn1.compat.octets import null
-def _cbFun(snmpEngine, sendRequestHandle, errorIndication,
+def __cbFun(snmpEngine, sendRequestHandle, errorIndication,
errorStatus, errorIndex, varBinds, cbCtx):
df = cbCtx['df']
df.callback(
@@ -26,7 +25,7 @@ class AbstractCommandGenerator:
contextEngineId,
contextName,
varBinds,
- _cbFun,
+ __cbFun,
{ 'df': df } # anonymous dictionary used for cbCtx
)
return df
@@ -65,7 +64,7 @@ class AbstractBulkCommandGenerator:
contextEngineId,
contextName,
varBinds,
- _cbFun,
+ __cbFun,
{ 'df': df } # anonymous dictionary used for cbCtx
)
return df
diff --git a/pysnmp/entity/rfc3413/twisted/ntforg.py b/pysnmp/entity/rfc3413/twisted/ntforg.py
index d527663..cc796b6 100644
--- a/pysnmp/entity/rfc3413/twisted/ntforg.py
+++ b/pysnmp/entity/rfc3413/twisted/ntforg.py
@@ -2,7 +2,7 @@ from twisted.internet import defer
from pysnmp.entity.rfc3413 import ntforg
from pyasn1.compat.octets import null
-def _cbFun(snmpEngine, metaSendPduHandle, errorIndication,
+def __cbFun(snmpEngine, sendRequestHandle, errorIndication,
errorStatus, errorIndex, varBinds, cbCtx):
cbCtx.callback(
(snmpEngine, errorIndication, errorStatus, errorIndex, varBinds)
@@ -30,7 +30,7 @@ class NotificationOriginator:
notificationName,
instanceIndex,
additionalVarBinds,
- _cbFun,
+ __cbFun,
df
)
return df