Skip to content

Commit

Permalink
Handle changed debug flag map of pyasn1/pysnmp
Browse files Browse the repository at this point in the history
  • Loading branch information
etingof committed Dec 30, 2018
1 parent b29bfcb commit 3b415d9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Revision 0.4.5, released 30-12-2018
- Optional .snmprec tag modifier is ignored by the *error*,
*delay*, *writecache* and *notification* variation modules
- Fixed DBM file index detection code to operate correctly
- Fixed pysnmp/pyasn1 debugging flags print out in `--help` to work
with newer pyasn1/pysnmp

Revision 0.4.4, released 20-02-2018
-----------------------------------
Expand Down
3 changes: 2 additions & 1 deletion scripts/mib2dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
[--unsigned-range=<min,max>]
[--integer32-range=<min,max>]""" % (
sys.argv[0],
'|'.join([x for x in debug.flagMap.keys() if x not in ('app', 'msgproc', 'proxy', 'io', 'secmod', 'dsp', 'acl')])
'|'.join([x for x in getattr(debug, 'FLAG_MAP', getattr(debug, 'flagMap', ()))
if x not in ('app', 'msgproc', 'proxy', 'io', 'secmod', 'dsp', 'acl')])
)

try:
Expand Down
7 changes: 4 additions & 3 deletions scripts/pcap2dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@
[--variation-module=<module>]
[--variation-module-options=<args>]""" % (
sys.argv[0],
'|'.join([x for x in pysnmp_debug.flagMap.keys() if x != 'mibview']),
'|'.join([x for x in pyasn1_debug.flagMap.keys()]),
'|'.join(log.gMap.keys())
'|'.join([x for x in getattr(pysnmp_debug, 'FLAG_MAP', getattr(pysnmp_debug, 'flagMap', ()))
if x != 'mibview']),
'|'.join([x for x in getattr(pyasn1_debug, 'FLAG_MAP', getattr(pyasn1_debug, 'flagMap', ()))]),
'|'.join(log.gMap)
)

try:
Expand Down
7 changes: 4 additions & 3 deletions scripts/snmprec.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,10 @@
[--variation-module-options=<args>]
[--continue-on-errors=<max-sustained-errors>]""" % (
sys.argv[0],
'|'.join([x for x in pysnmp_debug.flagMap.keys() if x != 'mibview']),
'|'.join([x for x in pyasn1_debug.flagMap.keys()]),
'|'.join(log.gMap.keys()),
'|'.join([x for x in getattr(pysnmp_debug, 'FLAG_MAP', getattr(pysnmp_debug, 'flagMap', ()))
if x != 'mibview']),
'|'.join([x for x in getattr(pyasn1_debug, 'FLAG_MAP', getattr(pyasn1_debug, 'flagMap', ()))]),
'|'.join(log.gMap),
'|'.join(sorted([x for x in authProtocols if x != 'NONE'])),
'|'.join(sorted([x for x in privProtocols if x != 'NONE']))
)
Expand Down
7 changes: 4 additions & 3 deletions scripts/snmpsimd.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,10 @@ def probeContext(transportDomain, transportAddress, contextName):
[--agent-udpv6-endpoint=<[X:X:..X]:NNNNN>]
[--agent-unix-endpoint=</path/to/named/pipe>]""" % (
sys.argv[0],
'|'.join([x for x in pysnmp_debug.flagMap.keys() if x != 'mibview']),
'|'.join([x for x in pyasn1_debug.flagMap.keys()]),
'|'.join(log.gMap.keys()),
'|'.join([x for x in getattr(pysnmp_debug, 'FLAG_MAP', getattr(pysnmp_debug, 'flagMap', ()))
if x != 'mibview']),
'|'.join([x for x in getattr(pyasn1_debug, 'FLAG_MAP', getattr(pyasn1_debug, 'flagMap', ()))]),
'|'.join(log.gMap),
'|'.join(sorted([x for x in authProtocols if x != 'NONE'])),
'|'.join(sorted([x for x in privProtocols if x != 'NONE']))
)
Expand Down

0 comments on commit 3b415d9

Please sign in to comment.