def setValue(self, value):
if value is None:
value = univ.noValue
value = self.clone(value)
# Run through states transition matrix,
# resolve new instance value
excValue, newState = self.stateMatrix.get(
(value.hasValue() and value or self.stNotExists,
self.hasValue() and self or self.stNotExists),
(MibOperationError, None)
)
if newState is None:
newState = univ.noValue
newState = self.clone(newState)
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 %r to %r yields state %r and exception' % (
self, value, newState), syntax=newState
)
raise excValue
return newState
评论列表
文章目录