SNMPv2-TC.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:pysnmp 作者: etingof 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号