-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use correct value for error handling #116
Conversation
Kudos, SonarCloud Quality Gate passed!
|
Codecov Report
@@ Coverage Diff @@
## master #116 +/- ##
=======================================
Coverage 96.08% 96.08%
=======================================
Files 30 30
Lines 1809 1809
=======================================
Hits 1738 1738
Misses 71 71
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
return self._object_type_to_mib_object(var_binds[0]) | ||
|
||
def _raise_errors( | ||
self, | ||
error_indication: Union[str, errind.ErrorIndication], | ||
error_status: str, | ||
error_index: int, | ||
*query: ObjectType, | ||
var_binds: Sequence[ObjectType], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better name, but I hope the change isn't due to shutting up mypy... Would
*var_binds: Optional[Sequence[ObjectType]],
work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would work, but the getCmd
commands and such always returns a list, and this function is meant to process that.
error_index
points to something in var_binds
, so taking a Sequence directly instead of *args felt more appropriate to me.
Optional
is a good point, that might be applicable for all the arguments
Fixes #81
Uses the
var_binds
return value from SNMP operations instead of the query input. See #81 for the reason why.