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

Fix issues where exitstatus could be nil #538

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

Fryguy
Copy link
Member

@Fryguy Fryguy commented Jan 3, 2025

In cases where the process did not exit properly, exitstatus could be nil. This, in turn, is being sent to exit, which causes

in `exit': no implicit conversion from nil to integer (TypeError)

exception, instead of exiting as expected.

@jrafanie Please review.

In cases where the process did not exit properly, exitstatus could be
nil. This, in turn, is being sent to exit, which causes

    in `exit': no implicit conversion from nil to integer (TypeError)

exception, instead of exiting as expected.
@Fryguy Fryguy added the bug Something isn't working label Jan 3, 2025
Copy link
Member

@jrafanie jrafanie left a comment

Choose a reason for hiding this comment

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

LGTM. I had some concern that there was a more intention revealing way to do this but I think this is still better than anything else I could find. success? looks nice at first but you want the exit status if it exited so it gets needlessly complicated.

@jrafanie jrafanie merged commit 43e6a84 into ManageIQ:master Jan 3, 2025
4 checks passed
@Fryguy Fryguy deleted the better_exit branch January 3, 2025 15:43
@Fryguy
Copy link
Member Author

Fryguy commented Jan 3, 2025

Yeah I would love if Ruby had a "system, but exit me with the same status code if it fails" type of method.

@jrafanie
Copy link
Member

jrafanie commented Jan 3, 2025

Yeah I would love if Ruby had a "system, but exit me with the same status code if it fails" type of method.

what a coincidence, that's exactly what I'd name it...

system_but_exit_with_same_exit_code_on_failure

🤣

It's a good thing naming is so easy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants