Skip to content
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

SNMP new types support + bug fix #1318

Merged
merged 5 commits into from
Jan 28, 2015
Merged

SNMP new types support + bug fix #1318

merged 5 commits into from
Jan 28, 2015

Conversation

yannmh
Copy link
Member

@yannmh yannmh commented Jan 27, 2015

  • Add Integer and Integer32 type support
  • Change the SNMP get command logic to solve the 'Missing OID' issue
  • Some PEP8 code cleaning

* Change the SNMP get command logic to solve the 'Missing OID' issue
* Some PEP8 code cleaning
@yannmh yannmh self-assigned this Jan 27, 2015
@yannmh yannmh added this to the 5.2.0 milestone Jan 27, 2015
self.raise_on_error_indication(error_indication, instance)

# Continue on error_status
if error_status:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit odd.
You created a function to deal with error_indication but you didn't with error_status, while the logic looks quite the same (except that one is raising an error).

What I suggest is something like this:

if error_indication:
  report_error_indication(error_indication, instance)

if error_status:
  report_error_status(error_status, instance)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

report_error_indication is raising an Exception and stops the check execution.

The reason why I didn't factorize report_error_status is because it has a continue (c.f your comment below) statement which refers directly to the upper level for loop.

@LeoCavaille LeoCavaille assigned LeoCavaille and unassigned yannmh Jan 28, 2015
@LeoCavaille
Copy link
Member

Looking good!

LeoCavaille added a commit that referenced this pull request Jan 28, 2015
@LeoCavaille LeoCavaille merged commit c89f2d2 into master Jan 28, 2015
@LeoCavaille LeoCavaille deleted the yann/snmp-enhancements branch January 28, 2015 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants