diff options
author | Ilya Etingof <etingof@gmail.com> | 2016-11-05 22:59:31 +0100 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2016-11-05 22:59:31 +0100 |
commit | c54a3f6dc8ee433a55001e1cd97f6801bd6e52b7 (patch) | |
tree | 36b8477a686d5e15a8c6ab028626c69e7303eb10 /pysnmp/hlapi/asyncio/cmdgen.py | |
parent | a0ef4b6ce81683dc33ae00b3dcedd1c4ec282249 (diff) | |
download | pysnmp-git-asyncio-dispatcher-fixes.tar.gz |
WIP: gracefully shutdown asyncio dispatcherasyncio-dispatcher-fixes
Diffstat (limited to 'pysnmp/hlapi/asyncio/cmdgen.py')
-rw-r--r-- | pysnmp/hlapi/asyncio/cmdgen.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/pysnmp/hlapi/asyncio/cmdgen.py b/pysnmp/hlapi/asyncio/cmdgen.py index d9a8d4d6..ea65961f 100644 --- a/pysnmp/hlapi/asyncio/cmdgen.py +++ b/pysnmp/hlapi/asyncio/cmdgen.py @@ -44,7 +44,7 @@ try: except ImportError: import trollius as asyncio -__all__ = ['getCmd', 'nextCmd', 'setCmd', 'bulkCmd', 'isEndOfMib'] +__all__ = ['getCmd', 'nextCmd', 'setCmd', 'bulkCmd', 'isEndOfMib', 'unconfigureCmdGen'] vbProcessor = CommandGeneratorVarBinds() lcd = CommandGeneratorLcdConfigurator() @@ -53,6 +53,21 @@ isEndOfMib = lambda x: not cmdgen.getNextVarBinds(x)[1] @asyncio.coroutine +def unconfigureCmdGen(snmpEngine, authData=None): + """Remove LCD configuration entry. + + If `authData` is not given, all currently configured LCD entries will be + removed. + + Note + ---- + Configuration entry removal may have a side effect of removing unused transport + and shutting down unused transport dispatcher. + """ + lcd.unconfigure(snmpEngine, authData) + + +@asyncio.coroutine def getCmd(snmpEngine, authData, transportTarget, contextData, *varBinds, **options): """Creates a generator to perform SNMP GET query. |