summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2018-04-19 01:10:24 +0200
committerIlya Etingof <etingof@gmail.com>2018-04-19 01:13:55 +0200
commit551e4c9a69bf5a562abf498c84e66397ccfa8155 (patch)
treed0d66124309a14b2d73699186e489d74417b64b3
parentb3dc9a6699e952b1bda29bf0f2a16a547d47d19d (diff)
downloadpysnmp-git-551e4c9a69bf5a562abf498c84e66397ccfa8155.tar.gz
fix InetAddressType rendering
-rw-r--r--CHANGES.txt6
-rw-r--r--pysnmp/smi/mibs/INET-ADDRESS-MIB.py4
-rw-r--r--pysnmp/smi/mibs/SNMPv2-TC.py2
3 files changed, 9 insertions, 3 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 36f4f8c4..34ea5879 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -13,6 +13,12 @@ Revision 5.0.0, released 2018-03-??
everything related to (non-standard) UNIX domain socket transport
are gone.
+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)