diff --git a/pynetsnmp/tableretriever.py b/pynetsnmp/tableretriever.py index 3f647d1..6471eb6 100644 --- a/pynetsnmp/tableretriever.py +++ b/pynetsnmp/tableretriever.py @@ -22,7 +22,7 @@ def __init__(self, limit=1000): self.proxy = proxy self.tableStatus = [_TableStatus(oid) for oid in oids] - self.defer = defer.Deferred() + self.defer = None if proxy.snmpVersion.find('1') > -1: self.how = proxy._walk else: @@ -34,6 +34,7 @@ def v2v3how(oids): self.hit_limit = False def __call__(self): + self.defer = defer.Deferred() self.fetchSomeMore() return self.defer @@ -52,7 +53,6 @@ def fetchSomeMore(self): for ts in self.tableStatus: results[ts.startOidStr]=dict([(asOidStr(oid), value) for oid, value in ts.result]) self.defer.callback(results) - self.defer = None def saveResults(self, values, ts): if values: @@ -75,4 +75,4 @@ def saveResults(self, values, ts): def error(self, why): self.defer.errback(why) - self.defer = None +