From 54bcd510d0a7e3e913e5962598fc2331dec545f8 Mon Sep 17 00:00:00 2001 From: elie Date: Sat, 6 Jun 2015 08:40:05 +0000 Subject: removed RowStatus default value as it may collide with possible subclass constraints --- CHANGES | 2 ++ pysnmp/smi/mibs/SNMPv2-TC.py | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index df8f841..a14a4cb 100644 --- a/CHANGES +++ b/CHANGES @@ -99,6 +99,8 @@ Revision 4.2.6 - MibBuilder now prepends the contents of environment variables it recognizes (PYSNMP_MIB_DIR, PYSNMP_MIB_DIRS, PYSNMP_MIB_PKGS) rather than using them instead of its default core MIBs. +- Removed RowStatus default value as it may collide with possible subclass + constraints. - Fix to authoritative engine side snmpEngineID discovery procedure: respond with notInTimeWindows rather then with unsupportedSecurityLevel at time synchronization phase. diff --git a/pysnmp/smi/mibs/SNMPv2-TC.py b/pysnmp/smi/mibs/SNMPv2-TC.py index 0dc0c37..f05b1bc 100644 --- a/pysnmp/smi/mibs/SNMPv2-TC.py +++ b/pysnmp/smi/mibs/SNMPv2-TC.py @@ -292,7 +292,6 @@ class RowStatus(Integer, TextualConvention): None, stNotExists ) } - defaultValue = stNotExists def setValue(self, value): value = self.clone(value) @@ -300,16 +299,16 @@ class RowStatus(Integer, TextualConvention): # Run through states transition matrix, # resolve new instance value excValue, newState = self.stateMatrix.get( - (value, self), + (value, self.hasValue() and self or self.stNotExists), (error.MibOperationError, None) ) newState = self.clone(newState) - debug.logger & debug.flagIns and debug.logger('RowStatus state change from %r to %s produced new state %r, error indication %r' % (self, value, newState, excValue)) + debug.logger & debug.flagIns and debug.logger('RowStatus state change from %r to %r produced new state %r, error indication %r' % (self, value, newState, excValue)) if excValue is not None: excValue = excValue( - msg='Exception at row state transition from %s to %s yields state %s and exception' % (self, value, newState), syntax=newState + msg='Exception at row state transition from %r to %r yields state %r and exception' % (self, value, newState), syntax=newState ) raise excValue -- cgit v1.2.1