diff options
author | Ilya Etingof <etingof@gmail.com> | 2018-04-19 01:10:24 +0200 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2018-04-19 01:10:24 +0200 |
commit | c41957644565b511471cece15eabaa0c47c2ad3b (patch) | |
tree | 297fd2c549dcda5c14250fff21fb2ad1aae665a4 | |
parent | dff00bf90f705b9ce2a19ca5784a1a91ef285e80 (diff) | |
download | pysnmp-git-c41957644565b511471cece15eabaa0c47c2ad3b.tar.gz |
fix InetAddressType rendering
-rw-r--r-- | CHANGES.txt | 1 | ||||
-rw-r--r-- | pysnmp/smi/mibs/INET-ADDRESS-MIB.py | 4 | ||||
-rw-r--r-- | pysnmp/smi/mibs/SNMPv2-TC.py | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 6effae80..0f96ddf1 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,7 @@ Revision 4.4.5, released 2018-04-XX ----------------------------------- +- Fixed broken InetAddressType rendering caused by a pyasn1 regression - Fixed typo in RFC1158 module Revision 4.4.4, released 2018-01-03 diff --git a/pysnmp/smi/mibs/INET-ADDRESS-MIB.py b/pysnmp/smi/mibs/INET-ADDRESS-MIB.py index 46684fbc..3ce2cd55 100644 --- a/pysnmp/smi/mibs/INET-ADDRESS-MIB.py +++ b/pysnmp/smi/mibs/INET-ADDRESS-MIB.py @@ -80,7 +80,7 @@ class InetAddress(TextualConvention, OctetString): for parentIndex in reversed(parentIndices): if isinstance(parentIndex, InetAddressType): try: - return parentRow.setFromName(cls.typeMap[parentIndex], value, impliedFlag, parentIndices) + return parentRow.setFromName(cls.typeMap[int(parentIndex)], value, impliedFlag, parentIndices) except KeyError: pass @@ -90,7 +90,7 @@ class InetAddress(TextualConvention, OctetString): for parentIndex in reversed(parentIndices): if isinstance(parentIndex, InetAddressType): try: - return parentRow.getAsName(self.typeMap[parentIndex].clone(self.asOctets()), impliedFlag, parentIndices) + return parentRow.getAsName(self.typeMap[int(parentIndex)].clone(str(self)), impliedFlag, parentIndices) except KeyError: pass diff --git a/pysnmp/smi/mibs/SNMPv2-TC.py b/pysnmp/smi/mibs/SNMPv2-TC.py index cad048b4..2e49352a 100644 --- a/pysnmp/smi/mibs/SNMPv2-TC.py +++ b/pysnmp/smi/mibs/SNMPv2-TC.py @@ -259,7 +259,7 @@ class TextualConvention(object): # how do we know if object is initialized with display-hint # formatted text? based on "text" input maybe? - if octets.isStringType(value) and not octets.isOctetsType(value): + if octets.isStringType(value): value = base.prettyIn(self, value) else: return base.prettyIn(self, value) |