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

add missing coercions #12

Merged

Conversation

colinsurprenant
Copy link
Contributor

Fixes #11
This adds some missing coercions for BITSTRING, COUNTER64 and NULL.
Tested manually locally, no spec coverage for this yet (working on it for larger Client class specs.

def coerce(variable)
variable_syntax = variable.getSyntax
# puts("variable.getSyntaxString=#{variable.getSyntaxString}")
case variable_syntax
when BER::OCTETSTRING
when BER::OCTETSTRING, BER::BITSTRING
Copy link
Member

Choose a reason for hiding this comment

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

is there any place we can find the whole list of possible options?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@jsvd jsvd left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@webmat webmat left a comment

Choose a reason for hiding this comment

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

LGTM

def coerce(variable)
variable_syntax = variable.getSyntax
# puts("variable.getSyntaxString=#{variable.getSyntaxString}")
case variable_syntax
when BER::OCTETSTRING
when BER::OCTETSTRING, BER::BITSTRING
Copy link

Choose a reason for hiding this comment

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

You have a require for java_import "org.snmp4j.smi.OctetString". Do you need to add one for BitString as well?

Actually I see you don't have requires for the counters. Ok, I guess I don't have enough context here :-)

Copy link

Choose a reason for hiding this comment

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

Yeah I figured out that it's probably coming from the asn1.BER import. Never mind :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the OctetString class is required for the build_target method - not needed for the coercion.

@colinsurprenant colinsurprenant merged commit b5d131a into logstash-plugins:master Jun 14, 2018
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