diff --git a/vlanmang.py b/vlanmang.py index 9d10a5e..66bb1b9 100644 --- a/vlanmang.py +++ b/vlanmang.py @@ -188,24 +188,10 @@ class SNMPSwitch(object): return varBinds def _get(self, oid): - oid = ObjectIdentity(*oid) - oid.resolveWithMib(_mvc) - - errorInd, errorStatus, errorIndex, varBinds = \ - next(getCmd(self._eng, self._cd, self._targ, ContextData(), ObjectType(oid))) - - if errorInd: # pragma: no cover - raise ValueError(errorIndication) - elif errorStatus: - raise ValueError('%s at %s' % - (errorStatus.prettyPrint(), errorIndex and - varBinds[int(errorIndex)-1][0] or '?')) - else: - if len(varBinds) != 1: # pragma: no cover - raise ValueError('too many return values') + varBinds = self._getmany(oid) - varBind = varBinds[0] - return varBind[1] + varBind = varBinds[0] + return varBind[1] def _set(self, oid, value): oid = ObjectIdentity(*oid)