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

catch detect failing to parse json #243

Merged
merged 2 commits into from
Jan 31, 2018
Merged

catch detect failing to parse json #243

merged 2 commits into from
Jan 31, 2018

Conversation

arlimus
Copy link
Contributor

@arlimus arlimus commented Jan 30, 2018

This may happen if the exit code is incorrect or the results get scrambled

Signed-off-by: Dominik Richter dominik.richter@gmail.com

@arlimus arlimus requested a review from a team January 30, 2018 21:32
Copy link
Contributor

@adamleff adamleff left a comment

Choose a reason for hiding this comment

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

Small nit about unnecessary exception object assignments, but otherwise, looks good to me :)

@platform[:release] = eos_ver['version']
@platform[:arch] = eos_ver['architecture']
true
rescue JSON::ParserError => _
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't even need the assignment here, can just be rescue JSON::ParserError.

@platform[:release] = eos_ver['version']
@platform[:arch] = eos_ver['architecture']
true
rescue JSON::ParserError => _
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't even need the assignment here, can just be rescue JSON::ParserError.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

force of habit 😁
removed it and updated the PR

This may happen if the exit code is incorrect or the results get scrambled

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
@adamleff adamleff merged commit b43f838 into master Jan 31, 2018
@arlimus arlimus deleted the dom/json-detect branch January 31, 2018 18:24
jerryaldrichiii pushed a commit that referenced this pull request Feb 5, 2018
* catch detect failing to parse json

This may happen if the exit code is incorrect or the results get scrambled

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>

* remove variable assignment

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
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.

2 participants