forked from etingof/pysnmp
-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
58 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
# Copyright (c) 2005-2020, Ilya Etingof <[email protected]> | ||
# License: https://www.pysnmp.com/pysnmp/license.html | ||
# | ||
from pyasn1.compat.octets import null | ||
from pyasn1.type import univ | ||
|
||
|
||
|
@@ -27,7 +26,7 @@ def __init__(self, snmpEngine, contextEngineId=None): | |
f'SnmpContext: contextEngineId "{self.contextEngineId!r}"' | ||
) | ||
self.contextNames = { | ||
null: snmpEngine.msgAndPduDsp.mibInstrumController # Default name | ||
b"": snmpEngine.msgAndPduDsp.mibInstrumController # Default name | ||
} | ||
|
||
def registerContextName(self, contextName, mibInstrum=None): | ||
|
@@ -38,7 +37,7 @@ def registerContextName(self, contextName, mibInstrum=None): | |
f"registerContextName: registered contextName {contextName!r}, mibInstrum {mibInstrum!r}" | ||
) | ||
if mibInstrum is None: | ||
self.contextNames[contextName] = self.contextNames[null] | ||
self.contextNames[contextName] = self.contextNames[b""] | ||
else: | ||
self.contextNames[contextName] = mibInstrum | ||
|
||
|
@@ -50,7 +49,7 @@ def unregisterContextName(self, contextName): | |
) | ||
del self.contextNames[contextName] | ||
|
||
def getMibInstrum(self, contextName=null): | ||
def getMibInstrum(self, contextName=b""): | ||
contextName = univ.OctetString(contextName).asOctets() | ||
if contextName not in self.contextNames: | ||
debug.logger & debug.FLAG_INS and debug.logger( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,6 @@ | |
# Copyright (c) 2005-2020, Ilya Etingof <[email protected]> | ||
# License: https://www.pysnmp.com/pysnmp/license.html | ||
# | ||
from pyasn1.compat.octets import null | ||
|
||
__all__ = ["ContextData"] | ||
|
||
|
||
|
@@ -46,7 +44,7 @@ class ContextData: | |
""" | ||
|
||
def __init__(self, contextEngineId=None, contextName=null): | ||
def __init__(self, contextEngineId=None, contextName=b""): | ||
self.contextEngineId = contextEngineId | ||
self.contextName = contextName | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,6 @@ | |
# Copyright (c) 2005-2020, Ilya Etingof <[email protected]> | ||
# License: https://www.pysnmp.com/pysnmp/license.html | ||
# | ||
from pyasn1.compat.octets import null | ||
|
||
|
||
from pysnmp import error, nextid | ||
from pysnmp.entity import config | ||
from pysnmp.entity.engine import SnmpEngine | ||
|
@@ -39,7 +36,7 @@ class CommandGeneratorLcdConfigurator(AbstractLcdConfigurator): | |
cacheKeys = ["auth", "parm", "tran", "addr"] | ||
|
||
def configure( | ||
self, snmpEngine, authData, transportTarget, contextName=null, **options | ||
self, snmpEngine, authData, transportTarget, contextName=b"", **options | ||
): | ||
cache = self._getCache(snmpEngine) | ||
if isinstance(authData, CommunityData): | ||
|
@@ -140,7 +137,7 @@ def configure( | |
|
||
return addrName, paramsName | ||
|
||
def unconfigure(self, snmpEngine, authData=None, contextName=null, **options): | ||
def unconfigure(self, snmpEngine, authData=None, contextName=b"", **options): | ||
cache = self._getCache(snmpEngine) | ||
if authData: | ||
if isinstance(authData, CommunityData): | ||
|
@@ -289,7 +286,7 @@ def configure( | |
|
||
return notifyName | ||
|
||
def unconfigure(self, snmpEngine, authData=None, contextName=null, **options): | ||
def unconfigure(self, snmpEngine, authData=None, contextName=b"", **options): | ||
cache = self._getCache(snmpEngine) | ||
if authData: | ||
authDataKey = ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.