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:13:55 +0200 |
commit | 551e4c9a69bf5a562abf498c84e66397ccfa8155 (patch) | |
tree | d0d66124309a14b2d73699186e489d74417b64b3 /pysnmp/smi | |
parent | b3dc9a6699e952b1bda29bf0f2a16a547d47d19d (diff) | |
download | pysnmp-git-551e4c9a69bf5a562abf498c84e66397ccfa8155.tar.gz |
fix InetAddressType rendering
Diffstat (limited to 'pysnmp/smi')
-rw-r--r-- | pysnmp/smi/mibs/INET-ADDRESS-MIB.py | 4 | ||||
-rw-r--r-- | pysnmp/smi/mibs/SNMPv2-TC.py | 2 |
2 files changed, 3 insertions, 3 deletions
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) |